Skip to content

WIP: dh_installsystemd: add --reload-or-restart option

Fabian Grünbichler requested to merge fg/debhelper:reload-or-restart into master

which uses systemd's (try-)reload-or-restart functionality to reload units instead of restarting, if supported by the unit.

this is especially helpful for services which support graceful reloading of their configuration or even re-executing themselves without dropping existing connections/clients.

Signed-off-by: Fabian Grünbichler f.gruenbichler@proxmox.com

WIP since it is still missing test cases. if the general direction / style of this is okay, I'll push an updated version with test cases.

in theory we could also go with

B<dh_installsystemd> [S<I<debhelper options>>] [B<--restart-after-upgrade>] [B<--reload-after-upgrade] [B<--reload-or-restart-after-upgrade>] [B<--no-stop-on-upgrade>] [B<--no-enable>] [B<--name=>I<name>] [S<I<unit file> ...>]

where --reload-or-restart-after-upgrade would (functionally) be this MR, and --reload-after-upgrade would mean reloading only. but because of the added --no-start this would mean even more snippets for little gain (especially since if a unit supports ExecReload, only ExecReload will be attempted by systemd anyway).

I did a quick test using one of our derivative packages by cherry-picking this MR on top of the current DH11 stretch-backports package, and it seems to work as intended FWIW.

Merge request reports

Loading