#1040364 orphan-sysvinit-scripts: add triggers to restart daemons

#1040364#5
Date:
2023-07-04 21:38:27 UTC
From:
To:
Dear Maintainer,

please consider adding triggers for restarting daemons when the executables
change (usually at package upgrade).

The following patch just mentions rsyslogd (newly orphaned script in bookworm),
but it should be easy to extend to other daemons handled by o-s-s.

Best regards,
	g.b.

#1040364#10
Date:
2023-07-04 22:07:09 UTC
From:
To:
	for t in "$@"; do

But I don’t think the trigger on the binary is necessary,
the trigger on the systemd thing would already catch it.

bye,
//mirabilos

#1040364#15
Date:
2023-07-04 22:29:55 UTC
From:
To:
Right.  I forgot to remove the binary from the triggers list after a
bunch of attempts.

However, the rest of the patch is really needed for restarting the daemon
on package upgrade.

bye,
	g.b.

#1040364#20
Date:
2023-07-05 15:39:33 UTC
From:
To:
Hi,

Is this always desireable? I'd normally expect a package postinst to
invoke-rc.d or similar.

Regards,

Matthew

#1040364#25
Date:
2023-07-05 16:30:13 UTC
From:
To:
Me too.  But Bookworm disagrees.  Release Notes don't even mention that
rsyslogd does not start at boot anymore unless you use systemd.

The section

which used to restart the daemon on package upgrade in bullseye/sysvinit,
disappeared from rsyslog.postinst in bookworm.  Therefore, no restart
happens unless systemd is in control.

Rsyslog's maintainer has dropped support for sysvinit and I'm afraid he is
not going to reconsider any time soon (see #1037039).

Since o-s-s already handles start of the daemon and log rotation, it might
the right package to also handle upgrades, at least for selected daemons.

Best regards,
    g.b.

#1040364#30
Date:
2023-07-05 16:36:23 UTC
From:
To:
This is bad. Let’s ask the debhelper maintainers why this
is no longer present, as the absence breaks orphan-sysvinit-scripts.

bye,
//mirabilos

#1040364#35
Date:
2023-07-05 16:46:42 UTC
From:
To:
I'm not sure that breaks o-s-s.

o-s-s has a trigger on /lib/systemd/system/rsyslog.service, therefore it
gets triggered when the package is upgraded to do its stuff w.r.t. the
init script, if necessary.

But it should also invoke-rc.d <service> try-restart, for perfection.

#1040364#40
Date:
2023-07-05 19:56:14 UTC
From:
To:
I don’t think so. I think the postinst of the services in question
restart the service, and that ought to “just work”, independent of
the init system in use, as long as an initsystem-compatible service
initscript is present (no matter whether it’s in the package itself
or in a separate one).

After all, not all packages restart services on upgrade; some pak‐
kages contain more than one service, not all of which are restarted
always, etc.

bye,
//mirabilos

#1040364#45
Date:
2023-07-07 21:38:06 UTC
From:
To:
Hi,

On Wed, 5 Jul 2023 18:36:23 +0200 (CEST) Thorsten Glaser <t.glaser@tarent.de> wrote:

If Debhelper/dh_installinit finds a debian/*.init file in the source of
the package then it installs it as init scripts and relevant snippets
are injected in maintscripts; when the *.init file is removed from the
source dh_installinit code become a noop and the snippets are gone.

Lorenzo

#1040364#50
Date:
2023-07-07 21:53:02 UTC
From:
To:
On Wed, 5 Jul 2023 21:56:14 +0200 (CEST) Thorsten Glaser <t.glaser@tarent.de> wrote:
even if debhelper is changed to inject maintscripts regardless of the
*.init script file in the source, non default actions are passed to
dh_installinit in the rules file, so in the case of an uncooperative
maintainer, there is no way for debhelper to know that it has to inject
non-default actions in the snippets.

#1040364#55
Date:
2026-08-18 14:25:36 UTC
From:
To:
control: tags -1 - patch

Hi,

It's not clear what the correct answer here is; but I think the supplied
patch is likely not the way to go, so I'm removing the patch tag.

Thanks,

Matthew

#1040364#62
Date:
2026-08-18 15:38:39 UTC
From:
To:
Bookworm has come and gone.  We got used to restarting rsyslogd manually
after upgrades.  Let's live with that also in Trixie.

Please, close the bug.

Best regards,
	g.

#1040364#67
Date:
2026-08-20 15:31:34 UTC
From:
To:
Hi,

OK, doing so. Sorry we didn't get a happier outcome.

Regards,

Matthew