On Tue, 2004-03-09 at 14:28, Michael Stone wrote: > If a services is never automatically started by any > runlevel the only way it will be running is if the admin launches it. I > do this all the time for things I don't want running on an automatic > basis, but which I might want when I'm testing something or somesuch. I > also switch runlevels to activate or deactivate certain functionality > (e.g., xdm) -- which is the point of runlevels in the first place. So > the question is, if I start a service manually, why would I want it > killed automatically as a side effect of doing something else?
You wouldn't. We agree on that. Where I think you have gone wrong is in thinking that Debian currently supports manual control of services via deletion of symlinks. It does not. The first problem (as has already been mentioned) is that in the absence of symlinks the service will be started on upgrade even if it wasn't running before the upgrade. If you solve this first problem by modifying invoke-rc.d so that it will do nothing in the absence of rc symlinks then you run into a second problem, namely, that in the absence of rc symlinks the service will _not_ be restarted on upgrade even if it _was_ running. To solve this problem you need to implement a "try-restart" method in the initscript of every service in Debian and call this from the postinst. To "try-restart" means to restart the service if and only if it is already running. (The name has been standardized by the LSB.) I have already implemented this method in the apmiser initscript and I helped to implement the one in fetchmail. So far as I know those and xprint are the only initscripts in Debian that do implement that method. > IMO, > setting a service to K state in an "up" runlevel only makes sense if you > start it in a different runlevel; that is, you only need automatic kill > if you use automatic start. ("up" runlevels being those that aren't > terminal; in most cases it does make sense to kill things in shutdown > runlevels.) In addition to meaning "stop what was started in another runlevel", K also means (for invoke-rc.d) "refrain from starting in this runlevel". -- Thomas