Bug 87287

Summary: path units should express a need for the unit they activate
Product: systemd Reporter: j.witteveen
Component: generalAssignee: systemd-bugs
Status: NEW --- QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: implementation of the proposed logic
implementation of the proposed logic (now with documentation)

Description j.witteveen 2014-12-13 15:39:33 UTC
Path units having either PathExists=, PathExistsGlob=, or DirectoryNotEmpty= should 'want' the unit they trigger as long as the path-condition is met. That way, a triggered unit can have StopWhenUnneeded=true to be truly path-based activated.

For example, with foo.path specifying PathExists=/foo and foo.service having StopWhenUnneeded=true, the service should be started whenever /foo exists or comes into existence and stopped whenever it is deleted. Currently, foo.service is stopped immediately when it is started by foo.path because it is not needed (anymore).
Comment 1 j.witteveen 2014-12-21 15:34:36 UTC
Created attachment 111110 [details] [review]
implementation of the proposed logic

The patch works as desired on my system. It does not update the manpage.
Comment 2 j.witteveen 2015-01-16 12:23:10 UTC
Created attachment 112339 [details] [review]
implementation of the proposed logic (now with documentation)

Same as the previous patch, but with documentation included. The patch did not generate any interest on the mailing list.

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.