Ubuntu’s “upstart” versus old school “update-rc.d”

Every distro seems to have their own damn way of managing startup services. One of these days I should really sit down and figure out how runlevels work.

Or maybe I’ll continue to ignore them since Ubuntu’s simplified (and fairly intuitive) upstart seems to be make it easier to not worry about levels.

Anyway, since Ubuntu is a bit schizophrenic these days with some services using upstart and others not, here are some handy commands for adding/removing startup services. Comments welcome since this is the kind of thing I do only very rarely.

initctl

$ initctl list shows a quick list of startup services. I’m not really sure what’s happening under the hood here, which is why it’s often useful to…

update-rc.d

…see what’s starting at various runlevels. Try this:

$ ls /etc/rc?.d

To see if amavis is starting on boot we can:

$ ls /etc/rc?.d | grep amavis
K21amavis
K21amavis
K21amavis
K21amavis
K21amavis
K21amavis
K21amavis

And since we don’t need it:

$ sudo update-rc.d -f amavis remove
Removing any system startup links for /etc/init.d/amavis ...
/etc/rc0.d/K21amavis
/etc/rc1.d/K21amavis
/etc/rc2.d/K21amavis
/etc/rc3.d/K21amavis
/etc/rc4.d/K21amavis
/etc/rc5.d/K21amavis
/etc/rc6.d/K21amavis

Leave a Reply

Your email address will not be published. Required fields are marked *