This site is for tech Q&A. Please keep your posts focused on the subject at hand.

Ask one question at a time. Don't conflate multiple problems into a single question.

Make sure to include all relevant information in your posts. Try to avoid linking to external sites.

Links to documentation are fine, but in addition you should also quote the relevant parts in your posts.

0 votes

I need to temporarily disable automatic management for a service on Ubuntu (using Upstart). I know I can remove the service startup/shutdown configuration via

update-rd.d -f SERVICE remove

but that would completely remove the configuration. I just want to disable automatic start/stop temporarily.

in Sysadmin
by (125)
3 19 33
edit history

Please log in or register to answer this question.

1 Answer

0 votes

update-rc.d is for managing System-V init scripts (in /etc/init.d), not Upstart jobs (in /etc/init). To temporarily disable services started by init scripts run

update-rc.d -f SERVICE disable

Re-enable by running

update-rc.d -f SERVICE enable

Replace SERVICE with the actual name of your service.

To temporarily disable Upstart jobs create a file with the same name as the service and the extension .override in the Upstart config directory. The content of the file should be just the word "manual."

echo 'manual' > /etc/init/SERVICE.override

Again, replace SERVICE with the actual name of your service.

With that file in place you can still manually start and stop the service (e.g. service SERVICE stop), but Ubuntu will no longer automatically start the service at system startup. If you create the file before installing the package the system also won't automatically start the service during installation.

Remove /etc/init/SERVICE.override to restore the default behavior.

For more information about Upstart overrides see here.

Addendum: On Ubuntu update-rc.d -f SERVICE disable also disables Upstart jobs, not just SysV init scripts.

edited by
by (125)
3 19 33
edit history