I have a selfmade init.d script on a Linux box that worked fine with Debian 4 and Debian 5 but with Debian 6 (fresh install) it gets only executed at system boot but not before rebooting.

The script is pratically this one:

# Provides:          selfheal
# Required-Start:
# Required-Stop:
# X-Start-Before:    mountall
# X-Stop-After:      umountfs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: selfheal tool
# Description:       Saves/restores the user partition at (re)boot

echo $0 $*
sleep 3

# some useful stuff follows here...

At reboot I see the system switching to runlevel 6 and unmounting the file systems (see that X-Stop-After: umountfs above). No sign of life from my selfheal script.

At system boot however, I see the echo line and the script is being executed.

I've installed the script using:

rm /etc/rc*.d/[SK]??selfheal && update-rc.d selfheal defaults

no errors/warnings there. The symlink exists:

root@intermodul:~# ls -al /etc/rc6.d/
total 12
drwxr-xr-x  2 root root 4096 May 16 16:09 .
drwxr-xr-x 68 root root 4096 May 16 16:07 ..
lrwxrwxrwx  1 root root   18 May 16 15:09 K09umountfs -> ../init.d/umountfs
lrwxrwxrwx  1 root root   18 May 16 16:09 K10selfheal -> ../init.d/selfheal
lrwxrwxrwx  1 root root   20 May 16 15:09 K10umountroot -> ../init.d/umountroot
lrwxrwxrwx  1 root root   16 May 16 15:09 K11reboot -> ../init.d/reboot
-rw-r--r--  1 root root  351 Jan  1 06:34 README

Note that with Debian 6 came concurrent booting and I guess there is something wrong with my "INIT INFO".

What is wrong here?


The script gets executed when setting CONCURRENCY=none in /etc/init.d/rc but I'd like to have makefile concurrency enabled. So, why doesn't the script get executed in makefile concurrency mode?

migrated from stackoverflow.com May 17 '11 at 13:10

This question came from our site for professional and enthusiast programmers.


I found the reason:

The script needed the following line in the BEGIN INIT INFO section so that the root fs is not being unmounted before my script finishes:

Should-Stop:       umountroot

This causes umountroot to become "dependent" on my script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.