Issue #3873 has been updated by Andre Nathan.

Was any consensus reached over this? I've just been bitten by this bug as my 
`onlyif` property runs `grep` searching for a path in a file, and a dependency 
to that path was added, resulting in a cycle...
----------------------------------------
Bug #3873: Unexpected dependency created by exec
https://projects.puppetlabs.com/issues/3873

Author: Ben Beuchler
Status: Accepted
Priority: Normal
Assignee: 
Category: RAL
Target version: 
Affected Puppet version: 0.25.4
Keywords: 
Branch: 


It looks like the Exec type is automatically creating dependencies on any files 
mentioned in the "onlyif" and "unless" parameters.  While I understand that 
this is likely to be the most commonly desired behavior, it can unexpectedly 
break things.  As an example, this is the code that triggered the behavior for 
me:

<pre>
class syslog-ng::weblogger inherits syslog-ng {
    $alp = "/var/spool/apache2/access_log_pipe"

    file { "/var/spool/apache2":
        ensure => directory,
        owner  => www-data,
        group  => www-data
    }

    File["/etc/syslog-ng/syslog-ng.conf"] {
        require => File[ "$alp" ]
    }

    # If apache started first and created $alp as a normal file, delete
    # it.
    exec { "cleanup_alp":
        command => "/bin/rm ${alp}",
        unless  => "/usr/bin/test -p ${alp}",
    }

    # If the FIFO doesn't exist, create it.
    exec { "access_log_pipe":
        command => "/usr/bin/mkfifo ${alp}",
        unless  => "/usr/bin/test -p ${alp}",
        require => Exec["cleanup_alp"],
    }

    # Ensure permissions are correct on the pipe.
    file { "$alp":
        ensure => present,
        owner  => www-data,
        group  => www-data,
        mode   => 0770,
        require => Exec["access_log_pipe"]
    }

}
</pre>

I'll attach the relevant section of the `--graph` output.  Note the unrequested 
dependency between `Exec[cleanup_alp]` and 
`File[/var/spool/apache2/access_log_pipe]`.

Filing this as a bug as suggested by Dan Bode: 
http://groups.google.com/group/puppet-users/browse_thread/thread/73a98af374c3f7f2


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to