The class below is designed to ensure that a fifo exists that will be
written to by Apache and read from by syslog-ng. I've attached the
relevant chunk of the dependency graph. It's obvious to me why
Exec[access_log_pipe] is a parent node of
File[/var/spool/apache2/access_log_pipe], but I don't understand why
there is any relationship at all between
File[/var/spool/apache2/access_log_pipe] and Exec[cleanup_alp]. I
assume there's an implied relationship created somehow, but I don't
see where. How can I restructure this relationship to avoid the
cycle?
Thanks!
-Ben
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" ]
}
## TODO: Write a FIFO resource.
# 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"]
}
}
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to
puppet...@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.