[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: automatically restarting dying daemons?



On Thu, Jul 01, 2004 at 02:31:44PM -0500, Will Trillich wrote:
| On Thu, Jul 01 at 05:59PM +0100, Thomas Adam wrote:
| > --- Will Trillich <will@serensoft.com> wrote: 
| > > 	#!/bin/bash
| > > 	/etc/init.d/some-daemon-here restart
| > 
| > Better to use 'invoke-rc.d' here:
| > 
| > invoke-rc.d <script> restart
[...]

| and WHY is invoke-rc.d * better than /etc/init.d/*? and is that
| reason still applicable for daemon configs?

I didn't know about invoke-rc.d before, but a quick read of the
(short) manpage explains :

       invoke-rc.d is a generic interface  to  execute	System	V  style  init
       script  /etc/init.d/name  actions, obeying runlevel constraints as well
       as any local policies set by the system administrator.
[...]
       invoke-rc.d introduces the concept of a policy layer which is  used  to
       verify  if  an  init  script should be run or not, or if something else
       should be done instead.	This layer has various uses, the most  immedi
       ate ones being avoiding that package upgrades start daemons outofrun
       level, and that a package starts or stops daemons while inside a chroot
       jail.


Interesting.


| ======
| 
| btw -- "restartd" seems to be just the item we're looking for.
| it's a bit terse, too, but it monitors already-running items and
| lets you specify a command to resurrect (or terminate)
| accordingly. not too advanced, and needs better documentation,
| but it works just fine -- at least, for us.

Simple and effective where a proper solution is lacking.  I learned of
it and used it to restart the jabberd aim transport when it would
crash.  (obviously the correct solution is code fixes to prevent
crashes)

-D

-- 
Religion that God our Father accepts as pure and faultless is this: to
look after orphans and widows in their distress and to keep oneself from
being polluted by the world.
        James 1:27
 
www: http://dman13.dyndns.org/~dman/            jabber: dman@dman13.dyndns.org

Attachment: signature.asc
Description: Digital signature


Reply to: