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

Re: invoke-rc.d & systemd



Henrique de Moraes Holschuh writes:
> On Sun, 07 Aug 2016, Ansgar Burchardt wrote:
>> That might behave different than expected when current state of the
>> daemon and the boot configuration differ: for example the sequence above
>
> It shouldn't, unless invoke-rc.d is broken.

It does as you say yourself:

> The whole reason it exists
> is exactly to account for boot state (i.e. enabled/disabled, as opposed
> to started/stopped).

But if you want to restart a running daemon, that action does *not*
depend on the boot configuration at all: it should be restarted if
running, but not started if it was not running before.  invoke-rc.d
doesn't help in this case.

>> start at boot; or it will stop the daemon if it was manually started but
>> is not configured to start automatically at boot.
>
> It has to stop it, yes.  That's exactly the point, since it is meant to
> be used during daemon upgrades.  We *usually* don't want a daemon
> running while its components and configuration are being updated under
> its feet, unless it is a daemon engineered to tolerate it well (which is
> actually easy to do on simple daemons, so it is actually the rule rather
> than the exception).

Well, the default for packages using debhelper has recently changed:

+---
| v10 This compatibility level is open for beta testing; changes may
| occur.
|
| Changes from v9 are:
| [...]
| - The dh_installinit command now defaults to --restart-after-upgrade.
|   For packages needing the previous behaviour, please use
|   --no-restart-after-upgrade.
+---[ man:debhelper(5) ]

So the default assumption for Debian is to expect this to work.

Changing the configuration and only then restarting the service also
matches what happens with most configuration changes besides packages
upgrades in my experience (either manual changes or changes applied by a
configuration management system).

Ansgar


Reply to: