daemon restart scripts

Eric Loyd loyd at cyber.kodak.com
Mon Jan 17 14:31:15 CET 2005



Andreas Ericsson wrote:

> Eric Loyd wrote:

[snip]

>> End result?  All services can be restarted by one modular event 
>> handler.  If a new service is added that needs a new series of 
>> restart steps, then a function is added to the restart script to do 
>> the work, and all else just "works."
>>
>
> This would be easier still if the service_description is the same as 
> the name of the init script.

That's true, assuming that only init scripts are used to restart 
services.  In some cases, "services" are really components of other 
services such as caches and so forth that require hitting a web page to 
flush a cache.  So what we've really done is to name the 
service_descriptions things like SSH:Service:Instance and 
Service:Instance:Parameter.  This lets us know if the service is 
tunneled over SSH or not, the name of the service (we'll say "Web" or 
"DNS" for instance), the specific instance of the service (port numbers 
in the case of web servers, other things for other services) and a 
parameter type attribute for things like caches.

The restart script looks for functions called do_<service> and passes 
various parameters to it.  So the modularity comes in needing to just 
write a single function in the restart script (say, do_web) that 
restarts web services.  Within that function, instances and other 
parameters can be parsed to determine if a full restart is required, a 
cache needs to be flushed, or whatever else we want to do.

It works for us.  Your mileage may vary.

-- 
Eric Loyd
loyd at cyber.kodak.com



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list