Python daemon

François Pinard pinard at iro.umontreal.ca
Thu Oct 17 16:33:13 EDT 2002


[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





More information about the Python-list mailing list