[Puppet Users] Re: onlyif (if only...)

Evan Hisey
Thu, 31 Jul 2008 14:40:54 -0000

On Thu, Jul 31, 2008 at 9:03 AM, Jeff <joesiege@gmail.com>
wrote:
>
> This barfs and I''m not sure why:
>
> exec { "avahi-daemon-stop":
>  onlyif   => "test -e /etc/init.d/avahi-daemon &&
/etc/init.d/avahi-
> daemon status | egrep -q -i running",
>  command  => "service avahi-daemon stop";
> }
>
> It produces the following error (which I''m trying to eliminate):
>
> err: /Class[main]/Node[kendricks.joedog.org]/Class[harden::linux]/
> Exec[avahi-dnsconfd-stop]: Failed to retrieve current state of
> resource: Could not find executable /etc/init.d/avahi-dnsconfd
>
> I''d like to execute service avahi-daemon stop onlyif it exists AND
> it''s running. Some help would be appreciated.
>
> TIA,
> Jeff
Would this not make more since to just use the Service type for doing this?

evan

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---