Starting and Stopping Services at Boot on Ubuntu with Upstart

By | 2013/10/30

With Ubuntu pushing ahead to using Upstart, there is a new /etc/init/ directory of the config files. Here is a quick how-to for controlling services with Upstart.


Start or Stop a Service

Firstly, starting or stopping services on a temporary basis is very straightforward:

$ sudo service mysql start
mysql start/running, process 10029

$ sudo service mysql stop
mysql stop/waiting

$ sudo service mysql status
mysql start/running, process 10029

$ sudo service mysql restart
mysql stop/waiting
mysql start/running, process 10185


How to disable a service at boot

Are you ready for this – you can’t. Well, not easily with upstart. The official method is:

Create a *.override file in /etc/init containing the word manual as per the upstart doc:

$ sudo echo "manual" >> /etc/init/myjob.override

To re-enable the service at boot, remove the .override file.

Note: This only applies to services that have been converted to Upstart!

4 thoughts on “Starting and Stopping Services at Boot on Ubuntu with Upstart

  1. whatever

    update-rc.d service disable

    will not work any more?

    Reply
    1. Scott Miller Post author

      Right now that _can_ still work as Ubuntu is in a sort of transition right now that has a mix of upstart and old style init scripts.

      However update-rc.d, chkconfig, sysv-rc-conf all are for the old init way and probably in the near future when all is upstart with Ubuntu those tools will not work anymore. Ubuntu removed the chkconfig package from 13.10, for example. :/

      Reply
  2. Calaverasgrande

    I didn’t see where it described how to START as service on boot.
    Stopping a service on boot is hardly a problem for me.

    Reply
    1. Scott Miller Post author

      This post is from 2013 and ancient. Ubuntu now uses systemd.

      Reply

Leave a Reply

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

Notify me of followup comments via e-mail. You can also subscribe without commenting.