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