Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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:

### BEGIN INIT INFO
# 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
### END INIT INFO

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 ..
<snip>
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?

Update

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?

share|improve this question
add comment

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

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

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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