Bug 87287 - path units should express a need for the unit they activate
Summary: path units should express a need for the unit they activate
Status: NEW
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-13 15:39 UTC by j.witteveen
Modified: 2015-01-16 12:23 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
implementation of the proposed logic (8.50 KB, patch)
2014-12-21 15:34 UTC, j.witteveen
Details | Splinter Review
implementation of the proposed logic (now with documentation) (9.68 KB, patch)
2015-01-16 12:23 UTC, j.witteveen
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.