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

Bug#804018: dpkg: provide options to avoid service startup on package installation


just talking into the wild here.

On Mon, Nov 09, 2015 at 06:07:24PM +0100, Evgeni Golov wrote:
> That said, back to the original topic. I agree with Patrick that we need 
> a flexble way to tell "the system" whether we want to start a specific 
> service on installation or not. The mentioned policy-rc.d system may 
> help here, but is not in the current state of documentation and 
> implementation.

I agree that policy-rc.d would be the right place. 

The policyrcd-script-zg2 package shows how this could be addressed. My
script just looks into /usr/local/sbin/policy-rc.d or
/etc/policy-rc.d and executes the files if they exist. This just moves
the place where the local admin places his local script into a
directory which is in her local domain, a rather trivial task.

For the task at hand, I would think that it would probably be a good
idea to have /etc/policy-rc.d as a directory which holds files called
like services. For example, to stop apache from being started on
package installation and upgrades, one would drop a file into
/etc/policy-rc.d/apache. That file could either contain configuration
data like a single line of "allowed", "undefined", "unknown",
"forbidden", "error" (see other values in
/usr/share/doc/sysv-rc/README.policy-rc.d.gz) or have there a simple
shellscript with the appropriate exit code.

That way would allow a per-service configuration of process start
behavior. The script handling the /etc/policy-rc.d/* file/scripts
could even be in a package (and I could finally retire the rather
trivial policyrcd-script-zg2).

Disclaimer: I do not know whether the new nice systemd world still
honors invoke-rc.d mechanisms. The scripts and documentation originate
from sysv-rc which is at least still present on my systemd-pid1-sid
systems, so there is hope.


Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

Reply to: