Java Reference
In-Depth Information
status_at() {
status /usr/sbin/atd
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload|restart)
restart
;;
condrestart)
if [ -f /var/lock/subsys/atd ]; then
restart
fi
;;
status)
status_at
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $?
exit $RETVAL
This script is from a RedHat Linux system. Those comments at the top
are a magic incantation for the chkconfig program that ships with that distri-
bution 11 (and with Fedora Core). We'll talk more about chkconfig in the next
section.
As you can see, the basic premise is that when a daemon is started, the
process ID is saved into a file. If the “stop” option is passed, the PID is looked
up and the process is killed. That's the basic idea. But wait! There's more!
Each runlevel has a directory of scripts. Let's look at the contents of such
a directory (Example 20.3).
11. The RedHat chkconfig program is conceptually similar to the one in the IRIX operating
system.
Search WWH ::




Custom Search