I want to use an exec in puppet onlyif its process is NOT running
exec { "execute me":
onlyif => "pgrep -fc 'ruby execute.rb'",
command => "execute me",
}
So on the above case, if the process 'ruby execute.rb' is already running, the exec should not run as
pgrep -fc 'ruby execute.rb' will return 1.
However
The command seems to always run in puppet.
On my linux box when I do pgrep -fc 'ruby execute.rb' I always get a value more than 0.
Is there something wrong with my command?