Guidelines

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
10 views
10 views

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 General by (0)

Your answer

Preview

Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
By submitting this post you agree to our Terms & Conditions.
To avoid this verification in future, please log in or register.

1 Answer

0 votes
 
Best answer

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.

by (0)
edited by
...