Re: start daemons according to current runlevel upon upgrade
> I have created two scripts named start-rc.d. One for runlevel links and
> one for file-rc. I think, they should be included in the corresponding
> packages which contain the update-rc.d skript (dpkg and file-rc).
Firstly, see bug#20373 where this is discussed. A policy change would
I would recommend start-stop-service as a name, parallelling
start-stop-daemon and you need the following logic, not including
error checking (and you beat me to it by just a couple of days);
remember that you need to check /etc/rcS.d as well!
<copy startup() from /etc/init.d/rc>
<baulk if #args!=2>
case "$2" in
# Check whether the daemon should be started
if [ -f $start ]; then startup $i $2
elseif [ -f $rcS_start ] && [ ! -f $stop ]; then startup $i $2
[ -f /etc/init.d/$service ] && /etc/init.d/$service stop
Note that this assumes that /etc/init.d/$service won't fall over if
you stop a stopped daemon or start a started one; this should probably
be made a policy requirement.
David Damerell and I have also been talking about ways of suspending
services, and will probably post some ideas in the next couple of
Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
Debian GNU/Linux Developer, see http://www.debian.org/~jdg