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!