There are a number of methods for managing the System V style init script links in Debian and Debian-derived Linux distributions, such as Ubuntu.  Using the built-in update-rc.d is perhaps the most common (look here for a couple of other tools).   This is somewhat analogous to chkconfig on Red Hat based distributions.If you drop a startup script in /etc/init.d and run a simple command (e.g. update-rc.d NewServiceName defaults, where NewServiceName is the newly installed application), all of the appropriate links will be created for you.

What happens if the script is itself a link to another location? For example, you install a third-party component that may be updated later. It is probably best not to copy or move the supplied startup script to /etc/init.d to avoid problems in the future. So you add a link, right? I recently came across something a bit odd.  I found an installer that created copies of the actual startup script in each of the System V startup directories, but nothing in /etc/init.d (not intuitive, since you look here for evidence of a new addition)  So I created a link, ran update-rc.d and got the following error:

System startup links for /etc/init.d/NewServiceName already exist.

The error is misleading, since they were not links but actual files.  After cleaning out the /etc/rcN.d directories, I could create proper links.  I may have problems after an upgrade;  I’m sure I’ll find out.  Some software vendors don’t seem to fully understand how System V startup is supposed to work, or at least proper hygiene.

I do like Debian, but I find chkconfig to be more complete.  Even the equivalent of chkconfig --list would be very helpful in update-rc.d.  Admittedly, sysv-rc-conf is another option. Use what suits you!

About these ads