-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Nick Moffitt wrote:
> Bill Proud:
>> I would have thought that the simplest solution would be to not use a
>> service at all but instead notify an exec from the file resource for
>> the configuration. The exec could run a simple script that checks if
>> the application is running and restarts it if it is.
>
> The trouble with execs is that they're so open-ended that a "puppet
> agent -t --noop" can't predict what will happen after one occurs. With
> a service it can at least assume that the refresh happened successfully
> and any notifications can trickle onward from there. With an exec it
> just says "um, except now we're noop. You're on your own from here,
> mate." It's like that old usenet rant about "given what you just did,
> it's perfectly within spec for the compiler to make demons fly out your
> nose!" Anything at all could happen!
>
> I feel like execs are something of a misfeature, but I'd be hard pressed
> to figure out how to live completely without them. I'm glad I have them
> available to do things like generate quick unique ssl snakeoil
> certificates or ssh keys, but I would hate to rely on them for something
> as central as the service resource.
In that case, how about modifying the /etc/init.d/<app> script (assuming Linux
and a standard sort of init.d script here) that does the restart and/or status
check to behave differently in the two different cases.
In the case of a crashed/dead app, the PID file will exist, but there won't be a
process on that PID (or rather, there won't be a correctly named process with
that PID). That's a dead app, so don't restart even if Puppet (or anyone else)
asks you to.
If there *is* an app at that PID, then the app is running and needs to be
restarted/reloaded as requested.
- --
Craig Miskell
Senior Systems Administrator
Opus International Consultants
Phone: +64 4 471 7209
OpenVMS: The OS with uptimes longer than MS Windows support policies
-- Browser window title of the www.openvms.org website
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAk0Q/0IACgkQmDveRtxWqnY7RwCghes4alH1WCDzFXFGVuYYUEPX
b9sAoKCOCJQHbfi5JIb4DQh/rPmt0X2V
=qOXR
-----END PGP SIGNATURE-----
--
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.