[Pkg-sysvinit-devel] systemd invoke-rc.d stop unsafe if socket is activated

Henrique de Moraes Holschuh hmh at debian.org
Sun Jul 27 01:45:26 UTC 2014

On Sun, 27 Jul 2014, Michael Biebl wrote:
> Am 26.07.2014 23:59, schrieb Henrique de Moraes Holschuh:
> > On Sat, 26 Jul 2014, Michael Biebl wrote:
> >> If invoke-rc.d by default stops both .socket and .service, the package
> >> maintainer no longer has this option.
> > 
> > This is incorrect.
> > 
> > You can extend "invoke-rc.d stop" with a --option that "quiesces the service
> > and terminates its running instances, but allows a (possibly immediate)
> > on-demand restart of the service by triggers such as socket activation"
> As maintainer of sysv-rc, do you have any suggestions how this interface
> should look like? And where and how it should be documented?

Adding the sysvinit ML to Cc.  Summary and previous context here:

Short summary for sysvinit-devel:

1. Right now, invoke-rc.d stop does not block socket activation in systemd.

2. This causes problems in packages that do not expect it.

3. There's a desire in the systemd camp to have this functionality
   available, so it is not just a matter of fixing invoke-rc.d.

I proposed that invoke-rc.d be extended with a new interface that implements
the desired behaviour, and that the current interface (invoke-rc.d stop)
must be changed so that it blocks socket activation under systemd.

Extending invoke-rc.d:

Looks like documentation should be added to the package providing
invoke-rc.d, which is currently sysv-rc.  There is a README.invoke-rc.d in
sysv-rc that needs to be updated.  The invoke-rc.d(8) manpage also has to be

We might want to clarify things in debian-policy after we finish and deploy
the fixed invoke-rc.d implementation for systemd.

Here's a not very creative suggestion for the new invoke-rc.d extension:

invoke-rc.d --allow-on-demand-activation stop

Bikeshedding over that naming is welcome.

and for the manpage:


   Note: the stop action will stop the service and also disable any
   automatic on-demand activation triggers for the stopped service, such as
   socket activation in systemd.  The on-demand triggers will be re-enabled
   when the service is started again.


	By default, when invoke-rc.d stops a service, any further
	activation of the service will be blocked until the service
	is explicitly started again.

	To keep the on-demand triggers enabled (for example:
	socket activation), use the --allow-on-demand-activation
	when issuing the stop action.

	This option is currently only defined for the stop action, and
	will be ignored on the other actions.  For forward compatibility
	reasons, scripts must not specify this option for any other actions
	than stop.

	WARNING: maintainer scripts must be very careful when using this
	option, as the service might be activated while dpkg is replacing
	files during a package upgrade, or service configuration is being
	updated, etc.  Services that start multiple executable modules or
	that have dynamic linked modules should never use this option.

  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

More information about the Pkg-sysvinit-devel mailing list