How to change order of start scripts?

Josef Wolf jw at raven.inka.de
Sun Sep 14 12:06:37 UTC 2008


Thanks for your answer, Erik!

On Sun, Sep 14, 2008 at 09:48:59PM +1000, Erik Christiansen wrote:
> On Sun, Sep 14, 2008 at 01:10:39PM +0200, Josef Wolf wrote:
[ ... ]
> > 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. ;-)

Hmm, I assumed there is a command which parses the comments and recreates
the symlinks with numbers based on the comments?

> You can use /usr/sbin/update-rc.d to manipulate the links, if desired.
> (Package scripts should, but you're not equally constrained.)

The manpage discourages the use of update-rc.d by sysadmins.

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

No.  Upstart is installed here.  Upstart manages backward compatibility.

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

Since I want to do this from scripts on various machines, I'd rather use
a method which will work with both, sysvinit and upstart. 

> (I'm
> just guessing that it may need networking. I'm not stopping to check
> what lirc might be. :-)

Lirc is a deamon for remote control.

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

AFAIK, sysvinit is going to die.  So I'd prefer a method that works with
upstart.  For the transition time, it would be preferable to have a method
that works with sysvinit also.





More information about the ubuntu-users mailing list