{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/14183","labels_url":"https://api.github.com/repos/saltstack/salt/issues/14183/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/14183/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/14183/events","html_url":"https://github.com/saltstack/salt/issues/14183","id":37757737,"number":14183,"title":"service does not restart after watched config","user":{"login":"kevich","id":2560726,"avatar_url":"https://avatars.githubusercontent.com/u/2560726?v=3","gravatar_id":"","url":"https://api.github.com/users/kevich","html_url":"https://github.com/kevich","followers_url":"https://api.github.com/users/kevich/followers","following_url":"https://api.github.com/users/kevich/following{/other_user}","gists_url":"https://api.github.com/users/kevich/gists{/gist_id}","starred_url":"https://api.github.com/users/kevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevich/subscriptions","organizations_url":"https://api.github.com/users/kevich/orgs","repos_url":"https://api.github.com/users/kevich/repos","events_url":"https://api.github.com/users/kevich/events{/privacy}","received_events_url":"https://api.github.com/users/kevich/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P2","name":"P2","color":"155fb5"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Platform%20Mgmt","name":"Platform Mgmt","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/49","html_url":"https://github.com/saltstack/salt/milestones/Beryllium","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/49/labels","id":896561,"number":49,"title":"Beryllium","description":"spheres","creator":{"login":"jfindlay","id":702905,"avatar_url":"https://avatars.githubusercontent.com/u/702905?v=3","gravatar_id":"","url":"https://api.github.com/users/jfindlay","html_url":"https://github.com/jfindlay","followers_url":"https://api.github.com/users/jfindlay/followers","following_url":"https://api.github.com/users/jfindlay/following{/other_user}","gists_url":"https://api.github.com/users/jfindlay/gists{/gist_id}","starred_url":"https://api.github.com/users/jfindlay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfindlay/subscriptions","organizations_url":"https://api.github.com/users/jfindlay/orgs","repos_url":"https://api.github.com/users/jfindlay/repos","events_url":"https://api.github.com/users/jfindlay/events{/privacy}","received_events_url":"https://api.github.com/users/jfindlay/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":16,"state":"open","created_at":"2014-12-08T23:36:57Z","updated_at":"2015-05-27T16:16:16Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2014-07-14T03:55:52Z","updated_at":"2015-05-28T14:36:13Z","closed_at":null,"body":"os: opensuse \r\nservice_provider: rh_service \r\nsalt-call --versions-report \r\nSalt: 2014.1.5 \r\nPython: 2.7.2 (default, Aug 19 2011, 20:41:43) [GCC] \r\nJinja2: 2.6 \r\nM2Crypto: 0.21.1 \r\nmsgpack-python: 0.2.4 \r\nmsgpack-pure: Not Installed \r\npycrypto: 2.3 \r\nPyYAML: 3.10 \r\nPyZMQ: 13.0.0 \r\nZMQ: 3.2.2 \r\n\r\nscenario: \r\n- on opensuse install postgresql-server package, \r\n- start service so it's generate default configs in /var/lib/pgsql \r\n- edit pg_hba with file.replace \r\n- expect service restart, but it just check if postgresql running and returns true \r\n\r\nif we edit pg_hba so file.replace runs again then service restarts ok, but not for the first run. I think it's somehow related to postgres_first_run starting service, but can't find anything \r\nrelevant in the logs \r\n\r\n example states from debug output: \r\n```\r\npostgresql:\r\n  pkg:\r\n    - installed\r\n    - name: postgresql-server\r\n  service:\r\n    - running\r\n    - enable: True\r\n    - watch:  \r\n      - file: /var/lib/pgsql/data/pg_hba.conf \r\n\r\n/var/lib/pgsql/data/pg_hba.conf: \r\n  file.replace:\r\n    - pattern: (^host.*127\\.0\\.0\\.1/32\\s*).*$ \r\n    - repl: \\1md5 \r\n    - watch: \r\n      - pkg: postgresql \r\n\r\npostgres_first_run: \r\n  cmd.wait:\r\n    - name: /etc/init.d/postgresql start >/dev/null 2>&1; sleep 5; echo -e '\\nchanged=yes\\n' \r\n    - stateful: True \r\n    - watch: \r\n      - pkg: postgresql \r\n    - watch_in: \r\n      - file: /var/lib/pgsql/data/pg_hba.conf \r\n```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/106360348","html_url":"https://github.com/saltstack/salt/issues/14183#issuecomment-106360348","issue_url":"https://api.github.com/repos/saltstack/salt/issues/14183","id":106360348,"user":{"login":"reissmann","id":833161,"avatar_url":"https://avatars.githubusercontent.com/u/833161?v=3","gravatar_id":"","url":"https://api.github.com/users/reissmann","html_url":"https://github.com/reissmann","followers_url":"https://api.github.com/users/reissmann/followers","following_url":"https://api.github.com/users/reissmann/following{/other_user}","gists_url":"https://api.github.com/users/reissmann/gists{/gist_id}","starred_url":"https://api.github.com/users/reissmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reissmann/subscriptions","organizations_url":"https://api.github.com/users/reissmann/orgs","repos_url":"https://api.github.com/users/reissmann/repos","events_url":"https://api.github.com/users/reissmann/events{/privacy}","received_events_url":"https://api.github.com/users/reissmann/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T14:36:13Z","updated_at":"2015-05-28T14:36:13Z","body":"Same for me on Debian 8 (jessie). It doesn't look to be service-specific. Here is an example for the service ferm:\r\n\r\n    ferm:\r\n      pkg.installed:\r\n        - name: ferm\r\n      service.running:\r\n        - name: ferm\r\n        - enable: True\r\n        - require:\r\n          - pkg: ferm\r\n        - watch:\r\n          - file: /etc/ferm/ferm.conf\r\n          - file: /etc/ferm.d/*\r\n    \r\n    ferm.conf:\r\n      file:\r\n        - managed\r\n        - name: /etc/ferm/ferm.conf\r\n        - source: salt://ferm/ferm.conf\r\n        - makedirs: True\r\n\r\nAfter making changes to ferm.conf, the new configuration file gets deployed to my server, but the service ferm does not restart."}}