Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There's a few daemons I disable from starting on boot-up. As an example, I use the following:

 sudo update-rc.d -f postgresql remove

I'm not even sure if that command is correct and I don't remember where I got it from.

Anyways, whenever I upgrade postgresql, the setting is lost (i.e. the daemon starts up on reboot).

share|improve this question
On Debian with SysVinit, I like file-rc. Instead of managing symlinks, I manage a text file with my runlevel configurations. – Gilles Jun 20 '11 at 22:38
up vote 10 down vote accepted

update-rc.d was initially used by package upgrade scripts. remove is called on package uninstall and removes all links, defaults is called on package install, enable or disable might be used depending on debconf and are useful to sysadmins. The cleanups remove does are not in fact useful to disable a service. From the man page:

A common system administration error is to delete the links with the thought that this will "disable" the service, i.e., that this will prevent the service from being started. However, if all links have been deleted then the next time the package is upgraded, the package's postinst script will run update-rc.d again and this will reinstall links at their factory default locations. The correct way to disable services is to configure the service as stopped in all runlevels in which it is started by default. In the System V init system this means renaming the service's symbolic links from S to K.

sudo update-rc.d postgresql disable will do what you want, because it keeps the rc.d symlinks but with the K (killed, stopped) prefix. Revert it with an enable. Some services support being disabled from their /etc/defaults/$service file, but sadly there are exceptions. Other ways to disable a service are to chmod -x the /etc/init.d/$service file, or to insert an exit 0 at the top of it.

share|improve this answer

Tobu is absolutely right, but for completeness there is a tool to give you a smart overview: sysv-rc-conf. For copy&patse:

apt-get install sysv-rc-conf

Running sysv-rc-conf you'll see which script is executed in which runlevel. You can enable/disable services via space and quit with q.

share|improve this answer
I also like rcconf, its in the standard repos. Remember though none of these will work with upstart, which is default on Ubuntu. Although plenty of stuff still uses the legacy init. – TechZilla Mar 9 '12 at 22:44

To clarify the best solution, similar to the answer Tobu gave:

  1. Do not use update-rc.d with the remove option.
  2. Instead, use update-rc.d with the disable option.

Example: update-rc.d postgresql disable

PLUS, You can also find (and disable) other, more specific services with systemctl.

Example: systemctl disable pppd-dns.service

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.