[asterisk-dev] daemonising after possible errors

Tzafrir Cohen tzafrir.cohen at xorcom.com
Fri Dec 8 17:21:02 MST 2006


On Fri, Dec 08, 2006 at 09:23:54AM -0800, Luigi Rizzo wrote:
> On Fri, Dec 08, 2006 at 05:48:10PM +0100, Martin Vít wrote:

> > Why not test confuguration before daemonizing?
> > asterisk -vvvdddgcd
> > if it starts and configs are ok, then stop and fork. Or you can tail -f 
> > /var/log/syslog (if logging into syslog) or tail -f 
> > /var/loga/asterisk/whateveryouwant before starting it

This ignores the problem. It maens that you have to keep plenty of
traces and such and be prepared to run Asterisk undaemonized just to see
that it starts. For every little change to the system. Not quite robust.

> 
> i agree. Failure to load a module is not fatal per-se.
> Given that there is plenty of mechanisms (see above) to
> figure out if something goes wrong, i don't think there is
> a real need to postpone forking after loading.

Failure of modules are surely potentially fatal. One common cause of
crashes is left-over incompatible modules. There are some other reasons
why modules would fail to load: if the unixodbc library is missing, then
a unixodbc module would fail to load. 

If that module has failed to load, what should Asterisk do:

1. Exit with an error.

2. Move on to the next module. Will a "reload" reload that module as
well? If a certain res module has failed to load, a nice little chain of
modules may fail with it. How do we know which modules need restarting?

Not from a brief look at the logs. Certainly not when you have enough
logging enabled.

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir


More information about the asterisk-dev mailing list