{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/37511","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/37511/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/37511/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/37511/events","html_url":"https://github.com/saltstack/salt/issues/37511","id":187708422,"number":37511,"title":"service.dead now only operates if the service file exists","user":{"login":"jdelic","id":1956349,"avatar_url":"https://avatars.githubusercontent.com/u/1956349?v=3","gravatar_id":"","url":"https://api.github.com/users/jdelic","html_url":"https://github.com/jdelic","followers_url":"https://api.github.com/users/jdelic/followers","following_url":"https://api.github.com/users/jdelic/following{/other_user}","gists_url":"https://api.github.com/users/jdelic/gists{/gist_id}","starred_url":"https://api.github.com/users/jdelic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdelic/subscriptions","organizations_url":"https://api.github.com/users/jdelic/orgs","repos_url":"https://api.github.com/users/jdelic/repos","events_url":"https://api.github.com/users/jdelic/events{/privacy}","received_events_url":"https://api.github.com/users/jdelic/received_events","type":"User","site_admin":false},"labels":[{"id":41387723,"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":41388135,"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143","default":false},{"id":194766302,"url":"https://api.github.com/repos/saltstack/salt/labels/P3","name":"P3","color":"0a3d77","default":false},{"id":194768064,"url":"https://api.github.com/repos/saltstack/salt/labels/Platform","name":"Platform","color":"fef2c0","default":false},{"id":41387450,"url":"https://api.github.com/repos/saltstack/salt/labels/State%20Module","name":"State Module","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":3219,"closed_issues":4142,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2016-11-07T21:55:41Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-11-07T13:13:25Z","updated_at":"2016-11-07T22:25:46Z","closed_at":null,"body":"# Issue\r\n\r\nPrevious to 2016.3.4 it was possible to have a `service.dead` state for a service that didn't exist on the system in the first place. 2016.3.4 now reports \"The named service XYZ is not available\". This makes it impossible to use Salt to ensure that a service is either disabled *or* not installed. It can now only be disabled.\r\n\r\nIn my repository I have two service states for Hashicorp consul. One for the \"consul agent\" and one for the \"consul server\". A specific node should only ever have one of these installed, so in my Salt configuration the \"consul agent\" configuration contains a `service.dead` clause for the \"consul server\" systemd service and the \"consul server\" configuration contains a `service.dead` clause for the \"consul agent\" systemd service.\r\n\r\nMy expected behavior was that if the node was assigned *one* of the states and the other state was previously installed, it would be shutdown and disabled. If *both* states got accidentally assigned, Salt would detect a conflict and report an error.\r\n\r\nThe above pattern is now broken. There seems to be no way for `service.dead` to also succeed when a service is not installed in the first place.\r\n\r\n## Potential solution\r\nAdd a flag `must_exist` to `service.dead`, `service.enable` and `service.disable` allowing Salt to *enable*, *disable* and *kill and disable* services only if they exist."},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/258983240","html_url":"https://github.com/saltstack/salt/issues/37511#issuecomment-258983240","issue_url":"https://api.github.com/repos/saltstack/salt/issues/37511","id":258983240,"user":{"login":"jdelic","id":1956349,"avatar_url":"https://avatars.githubusercontent.com/u/1956349?v=3","gravatar_id":"","url":"https://api.github.com/users/jdelic","html_url":"https://github.com/jdelic","followers_url":"https://api.github.com/users/jdelic/followers","following_url":"https://api.github.com/users/jdelic/following{/other_user}","gists_url":"https://api.github.com/users/jdelic/gists{/gist_id}","starred_url":"https://api.github.com/users/jdelic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdelic/subscriptions","organizations_url":"https://api.github.com/users/jdelic/orgs","repos_url":"https://api.github.com/users/jdelic/repos","events_url":"https://api.github.com/users/jdelic/events{/privacy}","received_events_url":"https://api.github.com/users/jdelic/received_events","type":"User","site_admin":false},"created_at":"2016-11-07T22:25:46Z","updated_at":"2016-11-07T22:25:46Z","body":"> Please feel free to submit that as a PR. Thanks\r\n\r\nWish that I were, but I know far too less about Salt internals to do so. Github just associated work-arounds that I committed to my Salt configurations with this ticket, because I had this ticket in the commit comments. Sorry 😞 "}}
{"actor":{"display_login":"jdelic"}}