I am currently looking at the startup and shutdown procedures for ubunut precise pangolin. As far as I understand at shutdown the system switches to runlevel 0 and all scripts with K*
are executed with the argument stop
and all scripts with S*
are executed with the argument start
.
Now looking at rc.0
I can see the following scripts:
lrwxrwxrwx 1 root root 16 1. Jan 2000 K20dhcpcd -> ../init.d/dhcpcd
lrwxrwxrwx 1 root root 20 1. Jan 2000 S35networking -> ../init.d/networking
lrwxrwxrwx 1 root root 14 5. Apr 2013 S90halt -> ../init.d/halt
lrwxrwxrwx 1 root root 20 5. Apr 2013 S60umountroot -> ../init.d/umountroot
lrwxrwxrwx 1 root root 18 5. Apr 2013 S40umountfs -> ../init.d/umountfs
lrwxrwxrwx 1 root root 22 5. Apr 2013 S31umountnfs.sh -> ../init.d/umountnfs.sh
lrwxrwxrwx 1 root root 17 5. Apr 2013 S30urandom -> ../init.d/urandom
lrwxrwxrwx 1 root root 18 5. Apr 2013 S20sendsigs -> ../init.d/sendsigs
lrwxrwxrwx 1 root root 19 26. Aug 2013 K90syslog-ng -> ../init.d/syslog-ng
Which means umountfs
, sendsigs
and halt
will be executed with the argument start
.
But looking at the code for example in S90halt
I find the following:
case "$1" in
start)
# No-op
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
do_stop
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
I.e. this script does nothing when it gets called with start
and only actually halts the system when it is called with stop
. I cannot find any reference to this script as a kill script, so when does this happen?