16

I want to disable a bunch of upstart jobs here. I know how to make a upstart job. And also I know how to stop manually a job. However, I can't find a sample where I turn a automatically job into a manually job. That is, I want the job to be started only when the user activate, for instance running this command (as root):

service job-name start

4 Answers4

15

Delete or comment out the start on part (using the number sign '#'). Commenting it out has the advantage of easy recoverability of the original state.

htorque
  • 64,798
  • You can also remove the start on part (or not add one, if you are writing a job yourself), but commenting it out is useful if you want to re-enable it later... – JanC Nov 12 '10 at 05:02
  • This one worked well. Autostart was disabled while I can manually start Mongod as a service. Thanks. – Nidhin David Jul 25 '16 at 14:29
9

Just for reference: Since upstart 0.6.7 (in Ubuntu since natty), there is a stanza called manual designed for just this purpose.

MvG
  • 1,506
5

As mentioned by @MvG, there is the manual stanza which declares an upstart service to be started manually only.

As root, put this into the .override file in /etc/init/ matching your job name:

echo "manual" > /etc/init/${JOB-NAME}.override

or using sudo:

echo "manual" | sudo tee /etc/init/${JOB-NAME}.override
quazgar
  • 162
0

Apache for example does not use 'upstart'. Apache is old fashioned Sys V link starting in rc2.d

The clue is when a service is missing such as : '/etc/init/apache2.conf'

In such cases you need good old fashioned SysV techniques.

A starting point is : Look for a README in /etc/init.d

Also GUI Tools exist for tweeking run levels

Nota Bene : upstart is getting depreciated, and eventually the distros are going to migrate to systemd. Oh what fun.