[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: enable/disable flags in /etc/default

Olaf van der Spek wrote:
> On Tue, Mar 1, 2011 at 4:16 PM, Steve Langasek <vorlon@debian.org> wrote:
>> You are using an interface that was never meant for administrator use.
>> Nowadays there's an 'update-rc.d enable/disable', but even that, I think,
>> was intended to be a backend for the 'service' command.
> So what *is* the proper UI?

Interesting that everyone talks about update-rc.d but it appears that nobody 
has read its documentation:

> 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 correctc 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.

That means:
# mv /etc/rc2.d/S??apache2 /etc/rc2.d/K00apache2
# insserv # this bit is not documented, it seems

And that's it, apache2 won't be started on runlevel 2.

Want to enable it again? make it an S and run insserv (so that the link's 
number and makefile-like list is updated)

Want to start it on that runlevel? "service apache2 start"

Raphael Geissert - Debian Developer
www.debian.org - get.debian.net

Reply to: