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

Re: Feedback needed: How to disable services at startup... and keep them so.



On Wed, Dec 8, 2010 at 8:23 AM, Camaleón <noelamac@gmail.com> wrote:
> On Tue, 07 Dec 2010 23:46:53 +0100, Jochem Kossen wrote:
> On Tue, 07 Dec 2010 23:46:53 +0100, Jochem Kossen wrote:
>> On Tue, Dec 07, 2010 at 04:21:38PM +0000, Camale?n wrote:
>>>
>>> A month ago, I disabled Network Manager service in my Squeeze system so
>>> it doesn't run on start up. I wanted to keep NM installed (just in
>>> case) but preferred to use the old "ifup" network setup method.
>>>
>>> So I issued "update-rc.d network-manager remove" and also disabled
>>> gnome NM applet from being started. So far so good, no more NM running
>>> at booting.
>>
>> Open the update-rc.d manpage, search for 'disable' and it says:
>>
>> ==
>> 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. ==
>>
>> You didn't disable network-manager. You removed the startup scripts
>> which were correctly put back by the update.
>>
>> Of course I only know this by being bitten by it several times in the
>> past ;-)
>
> Hum... good catch. Let's test it.
>
> First, I set the defaults runlevels for the script:
>
> root@debian:~# update-rc.d network-manager defaults
> update-rc.d: using dependency based boot sequencing
>
> Then, by following the example provided in the manual page on how to
> disable a service, I run:
>
> root@debian:~# update-rc.d -f network-manager remove
> update-rc.d: using dependency based boot sequencing
>
> And:
>
> root@debian:~# update-rc.d network-manager stop 20 2 3 4 5 .
> update-rc.d: using dependency based boot sequencing
> update-rc.d: warning: network-manager start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
> update-rc.d: warning: network-manager stop runlevel arguments (2 3 4 5) do not match LSB Default-Stop values (0 1 6)
>
> Now, I restart the system (rebooting...) and check for network manager
> service, that should have been disabled:
>
> test@debian:~$ /etc/init.d/network-manager status
> NetworkManager is running.
>
> But it is running.

"update-rc.d ... 20..." isn't ging to work with insserv (one reason
being that it numbers the "/etc/rcX.d" scripts indepedently of you).

The best way that I've found to deviate from the LSB headers is to use
"/etc/insserv/overrides/".


Reply to: