Le 13/04/2012 12:07, Craig Dunn a écrit :
To fail the resource if slaptest fails...
service { "slapd":
ensure => "running",
start => "/usr/sbin/slaptest && service slapd start",
}
To continue silently but not start slapd....
service { "slapd":
ensure => "running",
start => "( /usr/sbin/slaptest && service slapd start) || /bin/true",
}
Good point, I didn't understood this property could be defined as an
arbitrary shell command.
But, IMO, a service init script should take care of its own pre-req's...
Well, I see at least two reasons not to do it.
First, I'd actually like to make more than just 'restart only if
correct', rather something as 'if correct then reload, else notify'. In
order to use arbitrary notification mechanism (nagios, in our case, with
a mail fallback), I'd rather manage this out of init script.
The second is to avoid interfering with something wich is part of the
distribution. If I'm forking redhat iniscript, I have to follow any
fix/evolution/whatever, which is painful. BTW, redhat initscript already
support this kind of check, but only at start stage, meaning restart
action will do 'stop, check, and refuse to start' :(
--
BOFH excuse #230:
Lusers learning curve appears to be fractal
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.