I have decided to set-up a so called “super” server. Inetd has a very checkered past and the replacement for it is Xinetd. You can grab a copy of it here:
It hasn’t been updated in a long time, but it compiled just fine on my FreeBSD 7.2 system. Grab the source code from the above link, extract it, then run the following commands:
./configure –with-loadavg
make
make install
I created a configuration file here /etc/xinetd.conf with the following settings:
defaults
{
instances = 25
log_type = FILE /var/log/servicelog
log_on_success = HOST PID
log_on_failure = HOST
cps = 25 30
}
includedir /etc/xinetd.d
Create the /etc/xinetd.d directory. This is where the service scripts will go.
I have two services I am running currently with Xinetd, SSH and VSFTPD. The settings I used for each are as follows:
service ssh
{
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/local/sbin/sshd_start
server_args = -i
}
Quick note, follow the steps linked below for the SSH start-up script (and don’t forget to disable SSH if you have it your rc.conf file):
http://ubuntuforums.org/showthread.php?t=661061
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/vsftpd
nice = 10
}
I started with my FTP service to make sure everything is working with Xinetd. That way my SSH shell would always stay up while working out problems that came up.
Kill your FTP daemon (if you are doing the same) and verify it is off. Then execute the following command to get Xinetd running:
/user/local/sbin/xinetd -filelog /var/log/xinetd.log -f /etc/xinetd.conf
If you don’t see the process after running “ps -aux”, then take a look at the /var/log/xinetd.log file for errors. The errors are pretty easy to follow and understand.
Once I verified that Xinetd was running and verified that I could connect to my FTP service, I created a system start-up script in “/usr/local/etc/rc.d/xinetd_start.sh” with the following options:
#!/bin/sh
/usr/local/sbin/xinetd -filelog /var/log/xinetd.log -f /etc/xinetd.conf
Do a chmod 555 on your new startup script, reboot your system and verify that everything is running.
This guide has assumed that inetd is not running, but if it is, there is a Xconv.pl script that can be used to covert your settings to Xinetd. Anytime you add a new service, you will need to restart Xinetd, which I did with “kill -HUP (Xinetd Process ID)”


