SCO Unix inetd ISS
On occasion an ISS scan will terminate an inet daemon. The results is the system becoming unaccessible from the network. Telnet sessions do not work so access to solve the problem is limited to the console or any directly attached terminals.
The simple solution is to restart the inet daemon. However it requires access from the console or directly attached terminal. In this age of networking may systems are located some distance from where they are supported from. The following script can be run every 10 or 15 minutes from the cron facility. The crontab line would look something like this:
0,15,30,45 * * * * /etc/InetdScan
Then create the following script and save it as /etc/InetdScan Replace the work support on the mailx line with the appropriate ID.
# scan for the inetd daemon and make sure it is
# still running.
line="`ps -ef | grep inetd | grep -v grep`"
if [ "$line" ]
then
set $line
echo inetd pid is $2
else
mailx -s "Inetd failed on `uname -n`" support <<-%%
Inetd failed on `uname -n`... restarting
%%
# restart inetd
/etc/inetd
fi