Bug 87251 - RFE: sd_notify RELOADING=1 should propagate to PropagateReloadsTo= units
Summary: RFE: sd_notify RELOADING=1 should propagate to PropagateReloadsTo= units
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-11 22:56 UTC by j.witteveen
Modified: 2017-09-14 10:56 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
suggested fix (3.56 KB, patch)
2015-01-05 11:01 UTC, j.witteveen
Details | Splinter Review

Description j.witteveen 2014-12-11 22:56:33 UTC
sending a RELOADING=1 notification in service A nicely changes the state of service A into "reloading (reload)", but does not trigger a reload in a service B that propagate its reload from service A.
What is the purpose of notifying RELOADING=1 if it does not propagate?
Comment 1 dan 2015-01-03 23:18:23 UTC
I saw RELOADING=1 as a notice to systemd not start new services that depend on it until its back to READY=1.

This is just my assumption. A little more detail in http://www.freedesktop.org/software/systemd/man/sd_notify.html may be needed.

I don't think propagating a RELOAD to further services is needed and shouldn't be automatic. If a depending service fails I assume it will be restarted by systemd but otherwise its up the the depending service to handle transient failures of its dependencies.

I was planning on using this RELOADING=1 in a database that's not accepting any changes/connections because its getting a cluster peer up to date.

To me reloading doesn't imply the IPC between this an dependent services is going away or any stateful TCP connections will need to be remade.

Happy to consider alternate points of view or even implementation, however as long as its documented I can deal with it.
Comment 2 j.witteveen 2015-01-05 11:01:54 UTC
Created attachment 111760 [details] [review]
suggested fix

I agree that RELOADING=1 is just a message conveying state information to systemd. However, the message has a meaning and to me a service that has ReloadPropagatedFrom= indicates that it wants to be informed of precisely this meaning.
Comment 3 dan 2015-01-07 04:33:41 UTC
can you provide an example when this would be used?
Comment 4 j.witteveen 2015-01-07 15:01:11 UTC
I was thinking on writing a daemon that listens for certain kernel events. If an event occurs, it updates the status string of its governing service and signals RELOADING=1. If other services are supposed to act on such events they can register for reload propagation and retrieve the status string. Stopping the listener service disables signaling the registered service without stopping it entirely.

More specifically I was thinking of writing such a daemon to listen for a carrier and soft/hard blocks (rfkill) for a network interface.
Comment 5 Lennart Poettering 2017-09-14 10:56:13 UTC
This should work now, given that https://github.com/systemd/systemd/pull/6428 has been merged. Closing.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.