How to change order of start scripts?

Erik Christiansen dvalin at internode.on.net
Sun Sep 14 11:48:59 UTC 2008


On Sun, Sep 14, 2008 at 01:10:39PM +0200, Josef Wolf wrote:
> I have installed vdr and lirc on gutsy.  Most of the things seem to work,
> but the order of the start scripts is reversed:
> 
>   jw at vdr1:/home/jw$ ls /etc/rc3.d/*lirc /etc/rc3.d/*vdr|cat
>   /etc/rc3.d/S20vdr
>   /etc/rc3.d/S51lirc
>   jw at vdr1:/home/jw$ 
> 
> At the time vdr starts up, lirc is not available and vdr fails to use
> the remote control.
> 
> I know I can change the order by simply renaming the symlinks in
> /etc/rc?.d.  But I would like to use the "official" way to do this.
> It looks like the comments at the beginning of the start scripts
> are used to determine the order of script execution, but I can't
> figure out how this system works.

Nope, the comments don't do anything. It's the numbers which count. ;-)
You can use /usr/sbin/update-rc.d to manipulate the links, if desired.
(Package scripts should, but you're not equally constrained.)

> AFAIK, there were significant changes along the transition from
> sysvinit to upstart.

Last time I looked, we were facing inter alia:

There is no /etc/inittab, and runlevels will disappear. The /etc/rc?.d
and /etc/init.d directories will be replaced by /etc/event.d/

> Any hints how to properly change start script order?

Since you still have /etc/rc3.d/, we'll assume the traditional process.
The "Snnxxx" scripts are run on entering the runlevel, and in numerical
order.

So looking at all your S scripts, you might like to move S20vdr to e.g.
S60vdr, unless some lower numbered script depends on it. Moving S51lirc
below 20 may have it starting before services that it requires. (I'm
just guessing that it may need networking. I'm not stopping to check
what lirc might be. :-)

Tuning the numbers is the sysadmin's way that I've used for a decade or
more. The primary concern is ensuring that prerequisite services have a
lower number.

Erik

-- 
The public demands certainties;  it must be told definitely and a bit
raucously that this is true and that is false.  But there are no
certainties.
                -- H.L. Mencken, "Prejudice"





More information about the ubuntu-users mailing list