Python daemon

Jason Morgan jwm-python at sentinelchicken.net
Thu Oct 17 19:02:55 EDT 2002


On Thu, Oct 17, 2002 at 04:33:13PM -0400, Fran?ois Pinard wrote:
> [Cameron Laird]
> > Roman Suzi  <rnd at onego.ru> wrote:
> 
> >>3. restarting of the program if it fails, or the watchdog doesn't trigger
> >>Run the program from the /etc/inittab - if it terminates, init will
> >>restart it for you.
> 
> > From everything I know, Roman's exactly right, that /etc/inittab is the
> > right way to set up a process that you truly want to keep running.
> > However, many, MANY Unix hosts have all kinds of ugly home-brewed hacks to
> > duplicate this functionality.  I don't have an explanation, beyond the
> > rather tautologous observation that init(1) simply isn't as widely
> > understood as it deserves to be.
> 
> For an application that you never turn off, `init' might be perfect indeed.
> It will re-spawn your application whenever it terminates, and even protect
> you against thrashing, if your application is broken and does not start.
> 
> But you may want your application off at times, for maintenance say, maybe,
> without putting the whole system in maintenance mode.  `init' is a bit
> limited as far as run levels are concerned, and that might be a reason why
> it is not much used for various persistent applications which are not close
> to the operating system itself.
> 
> -- 
> Fran?ois Pinard   http://www.iro.umontreal.ca/~pinard

You may want to take a look at daemontools by Ban Burnstein. I has the ability to startup, 
log (using multilog), stop and admin any daemon you may want.

link: http://cr.yp.to/daemontools.html

jwm




More information about the Python-list mailing list