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