{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/8730","repository_url":"https://api.github.com/repos/systemd/systemd","labels_url":"https://api.github.com/repos/systemd/systemd/issues/8730/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/8730/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/8730/events","html_url":"https://github.com/systemd/systemd/issues/8730","id":314640831,"number":8730,"title":"determinism which of a set of conflicting services will be started","user":{"login":"cpaelzer","id":14993822,"avatar_url":"https://avatars3.githubusercontent.com/u/14993822?v=4","gravatar_id":"","url":"https://api.github.com/users/cpaelzer","html_url":"https://github.com/cpaelzer","followers_url":"https://api.github.com/users/cpaelzer/followers","following_url":"https://api.github.com/users/cpaelzer/following{/other_user}","gists_url":"https://api.github.com/users/cpaelzer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpaelzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpaelzer/subscriptions","organizations_url":"https://api.github.com/users/cpaelzer/orgs","repos_url":"https://api.github.com/users/cpaelzer/repos","events_url":"https://api.github.com/users/cpaelzer/events{/privacy}","received_events_url":"https://api.github.com/users/cpaelzer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-16T13:02:57Z","updated_at":"2018-04-16T14:01:31Z","closed_at":null,"author_association":"NONE","body":"### Submission type\r\n\r\n- Request for enhancement (RFE)\r\n\r\n### systemd version the issue has been seen with\r\n\r\n> systemd 237\r\n\r\n### Used distribution\r\n\r\n> Ubuntu\r\n\r\n### In case of bug report: Expected behaviour you didn't see\r\n\r\n> A way to control which of a set of conflicting services starts e.g. on boot\r\n\r\n### In case of bug report: Unexpected behaviour you saw\r\n\r\n> randomness picking one of the services without a way to control\r\n\r\n### In case of bug report: Steps to reproduce the problem\r\n\r\n> Create a set of conflicting services, here trivialized\r\n```\r\n# /lib/systemd/system/aa.service\r\n[Unit]\r\nDescription=AA\r\nConflicts=bb.service ss.service\r\nAfter=network.target\r\n[Service]\r\nType=forking\r\nExecStart=/usr/lib/systemd/scripts/aa.sh\r\n[Install]\r\nWantedBy=multi-user.target\r\n\r\n# /lib/systemd/system/bb.service\r\n[Unit]\r\nDescription=BB\r\nConflicts=aa.service ss.service\r\nAfter=network.target\r\n[Service]\r\nType=forking\r\nExecStart=/usr/lib/systemd/scripts/bb.sh\r\n[Install]\r\nWantedBy=multi-user.target\r\n\r\n# /lib/systemd/system/ss.service\r\n[Unit]\r\nDescription=SS\r\nConflicts=bb.service aa.service\r\nAfter=network.target\r\n[Service]\r\nType=forking\r\nExecStart=/usr/lib/systemd/scripts/ss.sh\r\n[Install]\r\nWantedBy=multi-user.target\r\n\r\n```\r\n\r\nThe shell scripts just loop, but any other similar test would do as well.\r\nI found this to start more or less a random one of the set.\r\n\r\nA real example to this is systemd-timesyncd vs chrony (or other NTP implementations).\r\nThey conflict and I see no way to control which one starts (while I'd want to prefer one of them).\r\nIn the past Ubuntu/Debian had \"ConditionFileIsExecutable=!/usr/sbin/chronyd\" in timesyncd but that was dropped in Debian [bug 873185](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873185).\r\nBut I think with above behavior you can't be sure which one actually starts.\r\n\r\nBefore re-adding the latter (which unfortunately can't detect if the offender is running) I wonder if there is (or could be) a better way to have conflicts ordered a la:\r\n\"A and B conflict, but if both are enabled prefer B\""},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/381609769","html_url":"https://github.com/systemd/systemd/issues/8730#issuecomment-381609769","issue_url":"https://api.github.com/repos/systemd/systemd/issues/8730","id":381609769,"user":{"login":"cpaelzer","id":14993822,"avatar_url":"https://avatars3.githubusercontent.com/u/14993822?v=4","gravatar_id":"","url":"https://api.github.com/users/cpaelzer","html_url":"https://github.com/cpaelzer","followers_url":"https://api.github.com/users/cpaelzer/followers","following_url":"https://api.github.com/users/cpaelzer/following{/other_user}","gists_url":"https://api.github.com/users/cpaelzer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpaelzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpaelzer/subscriptions","organizations_url":"https://api.github.com/users/cpaelzer/orgs","repos_url":"https://api.github.com/users/cpaelzer/repos","events_url":"https://api.github.com/users/cpaelzer/events{/privacy}","received_events_url":"https://api.github.com/users/cpaelzer/received_events","type":"User","site_admin":false},"created_at":"2018-04-16T14:01:31Z","updated_at":"2018-04-16T14:01:31Z","author_association":"NONE","body":"It seems there is some control, if\r\n```\r\nService A\r\nService B Conflicts A\r\n```\r\nThen always B will win.\r\nFor now we happen to guarantee this for my initial systemd-timesyncd / chrony issue via packaging rules.\r\nBut on the systemd level this still is an issue/feature-request as the following case is non deterministic between B and C\r\n\r\n```\r\nService A\r\nService B Conflicts A\r\nService C Conflicts A\r\n```\r\n\r\nI wonder if the latter could be expressed as\r\n```\r\nService A\r\nService B Conflicts A\r\nService C Conflicts A Conflicts B\r\n```\r\nto express the full ordering.\r\nIf that is the case, then I think no code change is needed, maybe some extra notes on the [doc](https://www.freedesktop.org/software/systemd/man/systemd.unit.html)"}}
{"actor":{"display_login":"cpaelzer"}}