1 TITLE: Setting up xinetd
3 AUTHOR: Peter Hall <peter.hall@hgus.gu.se>
6 How to setup the internet service daemon, xinetd.
11 Introduction to xinetd
13 Download location http://www.xinetd.org/pub/xinetd
16 Estimated Disk space required 1.3M
18 xinetd is an internet service daemon. Instead of having many
19 different servers running at the same time, only xinetd is loaded..
20 Whenever a request for a service is made, xinetd fires the
21 corresponding server up. It does this in a more secure manner
22 than it's precursor inetd.
24 Installation of xinetd
26 Install xinetd by running the following commands:
28 ./configure --prefix=/usr &&
38 Create the xinetd.conf file by running:
40 cat > /etc/xinetd.conf << "EOF"
41 # Begin /etc/xinetd.conf
43 # Default configuration options that apply to all servers, can be
44 # overriden per service.
49 log_type = FILE /var/log/service.log
50 log_on_success = HOST PID
51 log_on_failure = HOST RECORD
54 # The service name must be in /etc/services in order to obtain
56 # If it's a non-standard server/port, use "port = X"
63 server = /usr/sbin/proftpd
69 # socket_type = stream
74 # only_from = 127.0.0.1
75 # banner_fail = /etc/telnet_fail
76 # server = /usr/sbin/in.telnetd
86 server = /usr/sbin/sshd
96 server = /usr/local/apache/bin/httpd
101 # socket_type = stream
105 # no_access = 0.0.0.0
106 # only_from = 127.0.0.1
107 # banner_fail = /etc/finger_fail
108 # server = /usr/sbin/in.fingerd
112 # End /etc/xinetd.conf
117 Configuration information
119 Please note that this only is a sample configuration and you
120 will MOST CERTAINLY have to edit this to suite your needs.
121 However, I only have sshd on my system and the above configuration
122 works for me, xinetd states in /var/log/daemon.log that servers
123 are missing but still starts.
125 Configuring the daemons to use xinetd
127 One last thing you have to do before you're able to test xinetd out is
128 to make sure that your daemons know they're being started from
129 (x)inetd and not running in standalone mode.
131 For sshd this is accomplished by passing it an extra argument.
132 "server_args = -i" tells the SSH daemon that it should run in
135 Apache, Proftpd and probably many others handles this via their
136 config file. Find the line in /etc/httpd.conf and/or
137 /etc/proftpd.conf that reads:
138 "ServerType standalone"
139 and change standalone to inetd
141 Now run xinetd as root and make sure it works.
144 Make xinetd start on bootup
146 Create the /etc/rc.d/init.d/xinetd by running:
148 cat > /etc/rc.d/init.d/xinetd << "EOF"
150 # Begin /etc/rc.d/init.d/xinetd
153 # Include the functions declared in the /etc/init.d/functions file
156 source /etc/rc.d/init.d/functions
160 echo -n "Loading xinet super daemon"
161 loadproc /usr/sbin/xinetd
165 echo -n "Stopping xinet super daemon"
166 killproc /usr/sbin/xinetd
176 statusproc /usr/sbin/xinetd
180 echo "Usage: $0 {start|stop|reload|restart|status}"
186 # End /etc/init.d/xinitd
191 Make the script executable and create the appropriate symlinks by
194 chmod 755 /etc/rc.d/init.d/xinetd &&
195 ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc1.d/K110xinetd &&
196 ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc2.d/K110xinetd &&
197 ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc3.d/S30xinetd &&
198 ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc4.d/S30xinetd &&
199 ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc5.d/S30xinetd &&
200 ln -s /etc/rc.d/init.d/xinetd /etc/rc.d/rc6.d/K110xinetd
205 The xinetd package contains xinetd and itox
209 xinetd is a superdaemon, similar to inetd
213 itox converts inetd.conf style configuration files to xinetd.conf
216 Mail suggestions to peter.hall@hgus.gu.se