On Nov 2, 7:33 pm, Christopher Wood <christopher_w...@pobox.com>
wrote:
> It's worth mentioning that find -exec this way forks a separate copy of find 
> for each file. You'll notice how much slower this is on a really large set of 
> files (possibly larger than yours). If you have a recursion-capable chown 
> it's quicker to use chown -R.

Noted, this is what I'm using now:

exec { "enforce ${jetty_install_dir} permissions":
        command => "/bin/chown jetty:users ${jetty_install_dir}",
        onlyif  => "/usr/bin/test $(/usr/bin/find ${jetty_install_dir} ! -
user jetty -o ! -group users | wc -l) -gt 0",
        subscribe => [File["/opt/jetty/bin/jetty.sh"], File["/opt/jetty/
resources/log4j.xml"]],
        refreshonly => true,
}

I can see it execute ("notice: /Stage[main]//Exec[enforce /opt/
jetty-6.1.26 permissions]: Triggered 'refresh' from 1 events") but the
new files are still left with the wrong ownership. When I run the
"onlyif" command manually and echo $? I get 0, which says it should
run the chown. Can anyone see what I'm missing?

Cheers, Robert.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to