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

Re: RFC: update-rc.d <script> disable|reenable

* Michael Biebl <biebl@debian.org> [080922 14:43]:
> Kel Modderman wrote:
> > Hi all,
> > 
> > This email describes an extension of update-rc.d to provide an interface
> > for disabling and reenabling initscript sysvinit runlevel start links.
> > 
> Hi again,
> thinking more about it, I think a function "is-enabled" would be quite
> handy.
> This would allow to query the init system in a defined way, if a given
> service is enabled or disabled.
> Another idea would be, to define a new update-rc.d function called
> "status", which would return either "running, not running or disabled".
> There were some efforts recently, to add a status action to the init
> scripts, which would be a prerequiste of such a new interface to work
> properly.
> Cheers,
> Michael

I don't think disabling and enabling a service is the right paradigm.
What I want, when I am fiddling with services, is to switch between
automatic and manual.  In automatic mode, changes in runlevel do the
traditional starting and stopping of services based on the symlink farm
or runlevel.conf.  When a particular service is in manual mode, changes
in runlevel should do _absolutely nothing_ to that service (with the
obvious exception for runlevels 0 and 6).

If you implement "manual" mode, but not "disabling", you can easily get
the disabling behavior by switching to manual mode, stopping the
service, and then simply not starting it again.  On the other hand, it
is difficult to get the "manual" behavior if only "disabling" is
implemented.  If you disable a service, then start it manually, then in
order to change runlevel without killing the service you must
temporarily fiddle with the symlinks (or runlevel.conf).

The only case that disabling does better is if you want to disable a
service, start it manually, then have it automatically stop whenever the
runlevel changes.  I have never found a use for this behavior.

I think that manual mode can be implemented for the symlink farm by
renaming the symlink to have a leading character other than S or K (e.g.
"~"); do not replace the S or K, prepend the "~".  For runlevel.conf
(file-rc), it should be as simple as putting a leading "#~" on the lines
for that service.  update-rc.d can be made to recognize these changes
and behave accordingly.


Reply to: