Listing 2
:
#######################################################
# checkcron - check for various system daemons.
#
# designed to be run from $HOME/.profile in the
# background (enabling sysadm to 'automatically' check
# on daemon processes such as cron).
#
#######################################################
# loop through daemons of interest
for x in cron bind sendmail biod rpc.lockd rpc.statd ypbind
do
( ps -fu root | sed '/grep/d' | grep $x ) > /dev/null ||
echo "\n\t*** $x is DOWN ***\n"
done
# this portion demonstrates that you can use this login
# technique to check for things other than daemons.
# /dev/null turned into a regular file once and quickly
# grew large.
test -c /dev/null || echo "*** /dev/null is fouled ***"
|