saltstack/salt — Issue #552: service state require declaration breaks watch declaration
Author: jhutchins
Created: 2012-01-20 18:01:16+00:00
State: open

Running salt 0.9.5 on master and client with a simple sate file like the following

```yaml
postfix:
pkg:
- installed
service:
- enable: True
- running
- watch:
- file: /etc/postfix/main.cf

/etc/postfix/main.cf:
file:
- managed
- source: salt://pbx/postfix/main.cf
- template: jinja
- mode: 644
- require:
- pkg: postfix
```

A trivial change to the main.cf file produces the following output:

```shell
----------
State: - file
Name: /etc/postfix/main.cf
Function: managed
Result: True
Comment: File /etc/postfix/main.cf updated
Changes: diff: ---
+++
@@ -1,3 +1,4 @@
+#Test
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix

----------
State: - service
Name: postfix
Function: running
Result: True
Comment: Service restarted
Changes: postfix: True
```

However is you add a requires declaration for the postfix service state then the service no longer restarts.

State file:

```yaml
postfix:
pkg:
- installed
service:
- enable: True
- running
- require:
- pkg: postfix
- watch:
- file: /etc/postfix/main.cf

/etc/postfix/main.cf:
file:
- managed
- source: salt://pbx/postfix/main.cf
- template: jinja
- mode: 644
- require:
- pkg: postfix
```

Output:

```shell
----------
State: - file
Name: /etc/postfix/main.cf
Function: managed
Result: True
Comment: File /etc/postfix/main.cf updated
Changes: diff: ---
+++
@@ -1,4 +1,3 @@
-#Test
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
```