New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE: systemd.path should support deactivation #3642
Comments
Somewhat along the same lines, I have a path activated service who loads the watched path as an EnvironmentFile, since it contains configuration for the service's daemon. If that path changes (PathChanged or PathModified), the service just gets another start. https://github.com/systemd/systemd/blob/master/src/core/path.c#L481 Could JOB_RELOAD_OR_START work here instead? If the service could receive a reload, I could do something like the ExecReload example suggests in the systemd.service man page (assuming I make my daemon load the configuration file internally instead of using EnvironmentFile, and also handle SIGHUP to get notified of the change). Just receiving another start activation when monitoring PathChanged or PathModified doesn't seem to be very helpful to the path's service when long-running. Or is there a better way to handle this scenario all together? Also, reload seems nicer than a restart, since currently PathChanged\PathModified don't force any action on already running services, and since ExecReload is an optional directive. I'll be glad to put together a patch, but I wanted to make sure my scenario was keeping with the intent behind the design. |
Any news about this? It would be really nice if, when a path is removed, the .path unit is also set back to "waiting". |
@bkylerussell Kyle: please send the patch? Thank you. |
Is someone working on this? Would be really useful for me. |
I agree too, I believe the feature is very useful. |
I think there are valid use cases for this feature as mentioned in this thread and #3866. I am not sure about the design intent but I can try to get a patch and PR up and kick off the discussions on the specific implementation details from there. |
It is completely surprising to see such a feature not implemented. It's so natural to expect it and there are myriads of scenarios that would benefit from it. What exactly is the blocker with adding it? The path unit is IMHO incomplete without this. |
Submission type
systemd version the issue has been seen with
230
conspicuously, systemd.path mentiones only activation, but not deactivation
https://www.freedesktop.org/software/systemd/man/systemd.path.html
which is confirmed by the following test:
in other words,
systemd.path
initiatessystemd.service/start
actions for path activation (file created), but does not initiatesystemd.service/stop
actions for path deactivation (file deleted), despite properly detectinginotify
eventshttps://github.com/systemd/systemd/blob/master/src/core/path.c
test units
test unit.path:
test unit.service:
The text was updated successfully, but these errors were encountered: