{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/5604","repository_url":"https://api.github.com/repos/systemd/systemd","labels_url":"https://api.github.com/repos/systemd/systemd/issues/5604/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/5604/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/5604/events","html_url":"https://github.com/systemd/systemd/issues/5604","id":214890755,"number":5604,"title":"WantedBy=/Requisite= - fails to recognize the nonexistence of device units","user":{"login":"thx1111","id":8881258,"avatar_url":"https://avatars0.githubusercontent.com/u/8881258?v=3","gravatar_id":"","url":"https://api.github.com/users/thx1111","html_url":"https://github.com/thx1111","followers_url":"https://api.github.com/users/thx1111/followers","following_url":"https://api.github.com/users/thx1111/following{/other_user}","gists_url":"https://api.github.com/users/thx1111/gists{/gist_id}","starred_url":"https://api.github.com/users/thx1111/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thx1111/subscriptions","organizations_url":"https://api.github.com/users/thx1111/orgs","repos_url":"https://api.github.com/users/thx1111/repos","events_url":"https://api.github.com/users/thx1111/events{/privacy}","received_events_url":"https://api.github.com/users/thx1111/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-03-17T02:26:09Z","updated_at":"2017-05-27T13:57:48Z","closed_at":"2017-03-29T14:04:02Z","body":"  - [ ] Bug report\r\n  - [ ] Request for enhancement (RFE)\r\n\r\n> systemd 233-1\r\n> Arch\r\n\r\nsystemd does not know, a priori, that a `service` unit file may have the function of creating some `device` unit, or that, instead, another `service` unit file may not have the function of, itself, creating some `device` unit.\r\n\r\nWhen a `service` unit  has a `WantedBy` dependency upon *both* some `device` unit and some other `service` unit, systemd will not be able to \"interpret\", ahead of time, based upon the  present-time existence or non-existence of a `device` unit, whether that  `service` unit should or should not be enqueued to start, possibly so as to create the `device` unit, without some mechanism which informs systemd about what action to take.\r\n\r\nIt may be that some `service` unit, rather than creating a `device` unit, has the function of simply configuring a `device` unit.  And then, that `device` unit might, or might not, actually already exist at any particular time.\r\n\r\nIn those circumstance where a `service` unit only configures a `device` unit, and does *not* create a `device` unit, where instead, for instance, a `device` unit is created directly by `systemd-udevd`, by plugging a removable device, say, then systemd must have some mechanism to determine that the `service` unit must *not* be enqueued to start, in a situation in which the `device` unit *does not yet exist*.\r\n\r\nIt would seem apparent, reading from `man systemd.unit`, that a `Requisite` dependency in the `service` unit, such that the `service` unit depends upon the `device` unit, would inform systemd that the `service` unit should not be enqueued to start when the `device` unit does not exist.  Reading from `man systemd.unit`, at `Requisite=`:\r\n> if the units listed here are not started already, they will not be started\r\n> and the transaction will fail immediately.\r\n\r\nInstead, in systemd 233, a `service` unit `Requisite= sys-subsystem-net-devices-%p.device` fails to recognize when the listed `device` unit does not exist.  Of course, then, \r\nthe `service` unit is started and then fails, with errors:\r\n> command failed: No such device (-19)\r\n> Cannot find device ...\r\n> Main process exited, code=exited, status=1/FAILURE\r\n> Failed to start ...\r\n> Unit entered failed state.\r\n> Failed with result 'exit-code'.\r\n\r\nThis is a bug and should be fixed.  `Requisite=` must properly recognize `device` units, when they exist, and when they *do not* exist, in determining the proper time at which to enqueue a `service` unit to start.\r\n\r\nThe `WantedBy` dependency does work correctly when a `device` unit appears, as when a device is plugged, or when another `service` unit is started.  But `WantedBy`, or the complementary `Wants`, must be \"qualified\" by, be made conditional upon, the `Requisite` dependency.\r\n\r\nIt might be argued that the `After` dependency could be used in place of the `Requisite` dependency.  Instead, the `After` dependency also fails as a condition for preventing the start of the `service` unit, *and* creates an additional problem, where consequent `service` units cannot start until after `DefaultTimeoutStartSec`, where the dependent `service` unit is \"waiting\", in futility, for the `device` unit to start.  In fact, this use of `After` can pointlessly block the entire boot process for `DefaultTimeoutStartSec`, and is a very wrong approach.\r\n"},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/304453063","html_url":"https://github.com/systemd/systemd/issues/5604#issuecomment-304453063","issue_url":"https://api.github.com/repos/systemd/systemd/issues/5604","id":304453063,"user":{"login":"vad1m","id":4972348,"avatar_url":"https://avatars2.githubusercontent.com/u/4972348?v=3","gravatar_id":"","url":"https://api.github.com/users/vad1m","html_url":"https://github.com/vad1m","followers_url":"https://api.github.com/users/vad1m/followers","following_url":"https://api.github.com/users/vad1m/following{/other_user}","gists_url":"https://api.github.com/users/vad1m/gists{/gist_id}","starred_url":"https://api.github.com/users/vad1m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vad1m/subscriptions","organizations_url":"https://api.github.com/users/vad1m/orgs","repos_url":"https://api.github.com/users/vad1m/repos","events_url":"https://api.github.com/users/vad1m/events{/privacy}","received_events_url":"https://api.github.com/users/vad1m/received_events","type":"User","site_admin":false},"created_at":"2017-05-27T13:57:48Z","updated_at":"2017-05-27T13:57:48Z","body":"@poettering ?"}}
{"actor":{"display_login":"vad1m"}}