Brian Seppanen wrote: > So what I need to do is configure cfengine to detect if this file > exists as a pipe or as a regular file. If it exists as a regular file > delete the file and create a pipe, and make sure the ownership and > permissions are correct.
... > I think I've seen an ifFileExists ( ), but I'm not sure that would > work. You might be interested in: http://www.cfengine.org/docs/cfengine-Reference.html#Evaluated-classes-and-special-functions There is no test for pipeness, but IsPlain() might be useful to detect non-pipes, depending on the logic you prefer. This is what I would do: classes: is_pipe = ( ReturnsZero(/bin/sh -c ' /bin/ls -l /path/to/pipe | /bin/grep ^p >/dev/null 2>&1 ') ) shellcommands: !is_pipe:: "/bin/rm -f /path/to/pipe" "/usr/bin/mkfifo /path/to/pipe" "/bin/chown ${pipe_ownership} /path/to/pipe" "/bin/chmod ${pipe_mode} /path/to/pipe" You could also add a files: section so the permissions get verified on every run, even when is_pipe evaluates to true. Best, Brendan _______________________________________________ Help-cfengine mailing list Help-cfengine@gnu.org http://lists.gnu.org/mailman/listinfo/help-cfengine