[5f5a393] | 1 | <sect2>
|
---|
| 2 | <title>Configuring xinetd</title>
|
---|
[e80cc95] | 3 | <para>Create the <filename>xinetd.conf</filename> file with the following commands: </para>
|
---|
[5f5a393] | 4 |
|
---|
[7319b78] | 5 | <para><screen><userinput>cp /etc/xinetd.conf /etc/xinetd.conf.bak
|
---|
| 6 | sed -e 's/etc/sbin/g' xinetd/sample.conf > /etc/xinetd.conf</userinput></screen></para>
|
---|
[5f5a393] | 7 |
|
---|
| 8 | <sect3><title>Config files</title>
|
---|
[e80cc95] | 9 | <para><filename>/etc/xinetd.conf</filename></para>
|
---|
[5f5a393] | 10 |
|
---|
| 11 | <para>Create the xinetd boot script:</para>
|
---|
[677a0f7] | 12 | <para><screen><userinput>cat > /etc/rc.d/init.d/xinetd << "EOF"</userinput>
|
---|
[5f5a393] | 13 | #!/bin/bash
|
---|
| 14 | # Begin $rc_base/init.d/xinetd
|
---|
| 15 | # Based on sysklogd script from LFS-3.1 and earlier.
|
---|
| 16 | # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
---|
| 17 | source /etc/sysconfig/rc
|
---|
| 18 | source $rc_functions
|
---|
| 19 | case "$1" in
|
---|
| 20 | start)
|
---|
| 21 | echo "Starting xinetd..."
|
---|
| 22 | loadproc /usr/sbin/xinetd
|
---|
| 23 | ;;
|
---|
| 24 | stop)
|
---|
| 25 | echo "Stopping xinetd..."
|
---|
| 26 | killproc /usr/sbin/xinetd
|
---|
| 27 | ;;
|
---|
| 28 | reload)
|
---|
| 29 | echo "Reloading xinetd..."
|
---|
| 30 | killall -HUP xinetd
|
---|
| 31 | ;;
|
---|
| 32 | restart)
|
---|
| 33 | $0 stop
|
---|
| 34 | sleep 1
|
---|
| 35 | $0 start
|
---|
| 36 | ;;
|
---|
| 37 | status)
|
---|
| 38 | statusproc /usr/sbin/xinetd
|
---|
| 39 | ;;
|
---|
| 40 | *)
|
---|
| 41 | echo "Usage: $0 {start|stop|reload|restart|status}"
|
---|
| 42 | exit 1
|
---|
| 43 | ;;
|
---|
| 44 | esac
|
---|
| 45 | # End $rc_base/init.d/xinetd
|
---|
[677a0f7] | 46 | <userinput>EOF</userinput></screen></para>
|
---|
[5f5a393] | 47 |
|
---|
| 48 | <para>Add the run level symlinks:</para>
|
---|
[7319b78] | 49 |
|
---|
| 50 | <para><screen><userinput>chmod 754 /etc/rc.d/init.d/xinetd &&
|
---|
[17ced16] | 51 | ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc0.d/K49xinetd &&
|
---|
| 52 | ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc1.d/K49xinetd &&
|
---|
| 53 | ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc2.d/K49xinetd &&
|
---|
[84d2b63] | 54 | ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc3.d/S23xinetd &&
|
---|
| 55 | ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc4.d/S23xinetd &&
|
---|
| 56 | ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc5.d/S23xinetd &&
|
---|
[ed19912] | 57 | ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc6.d/K49xinetd
|
---|
[5f5a393] | 58 | </userinput></screen></para>
|
---|
| 59 |
|
---|
| 60 | <para>Now, we'll use our new boot script to start xinetd: </para>
|
---|
[7319b78] | 61 | <para><screen><userinput>/etc/rc.d/init.d/xinetd start</userinput></screen></para>
|
---|
[5f5a393] | 62 |
|
---|
| 63 | <para>Checking the <filename>/var/log/daemon.log</filename> file
|
---|
| 64 | should prove quite entertaining. This file may contain entries
|
---|
| 65 | similar to the following: </para>
|
---|
| 66 |
|
---|
[7319b78] | 67 | <para><screen><userinput>Aug 22 21:40:21 dps10 xinetd[2696]: Server /usr/sbin/in.rlogind is not
|
---|
[5f5a393] | 68 | executable [line=29]
|
---|
| 69 | Aug 22 21:40:21 dps10 xinetd[2696]: Error parsing attribute server -
|
---|
| 70 | DISABLING SERVICE [line=29]
|
---|
| 71 | Aug 22 21:40:21 dps10 xinetd[2696]: Server /usr/sbin/in.rshd is not
|
---|
[7319b78] | 72 | executable [line=42]</userinput></screen></para>
|
---|
[5f5a393] | 73 |
|
---|
| 74 | <para>These errors are due to the fact that we don't have most of the
|
---|
| 75 | servers that xinetd is trying to control installed yet.</para></sect3>
|
---|
| 76 | </sect2>
|
---|
| 77 |
|
---|