needrestart icon indicating copy to clipboard operation
needrestart copied to clipboard

systemd: new needs-reload/needs-restart unit interface

Open bluca opened this issue 4 years ago • 1 comments

systemd v248 will ship with a new dbus/systemctl interface to mark a unit as needing reload/restart, and a new dbus/systemctl to queue all reload/restart jobs in a single command.

It looks like this:

systemctl set-property foo.service Markers=needs-restart systemctl set-property bar.service Markers=needs-reload ... systemctl reload-or-restart --marked

(or equivalent DBUS calls)

References:

https://github.com/systemd/systemd/commit/ff68472a20c208121b69ea13586f3105a219bc14 https://github.com/systemd/systemd/commit/c9615f73521986b3607b852c139036d58973043c https://github.com/systemd/systemd/pull/18481/commits

The advantage being, you can mark a unit inline, but then batch the actual jobs later/asynchronously.

Could this be of interest for usage in needrestart?

bluca avatar Feb 16 '21 10:02 bluca

Thanks for the hint. Needrestart already collects the services requiring to be restarted and runs a single systemctl restart command.

Adding a setting or command line option to only mark services rather than restarting them might be a useful use case.

liske avatar Sep 18 '21 09:09 liske