2008/11/24 Alan Sparks <[EMAIL PROTECTED]>

>
> Are there any examples of how something like this would work?  Can't
> seem to grasp it from documentation, how I could creat a tag like
> "apache_broken" and apply that to something that would force a restart
> of the service.  The issue is, "ensure" is not adequate, since the
> service could appear to be running but is actually failing...
> Thanks for the hint.
> -Alan
>


There are a couple of things you could do here.  If your service appears to
be running but isn't, you might just want to write an init script that does
a better job of determing the status.   You could also specify a command to
run to verify status with the 'status' option[1] for the service type, eg
you could run whatever check your monitoring system runs locally.

Failing that, you could do something like this:

class apache {
    # do your normal apache things
    # including starting the service:
    service { "apache": ensure => 'running' }

}

class apache::forcerestart inherits apache {
    exec { "killall -9 httpd":
       before => Service["apache"],
    }
}


then from puppetrun you could just do:


puppetrun -t apache::forcerestart <host where apache is not running
correctly>


If there were any other common fixes for why the service might all of the
sudden stop working you could impliment them in the apache::forcerestart
class.

.r'

[1]: http://reductivelabs.com/trac/puppet/wiki/TypeReference#service

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to