[asterisk-dev] daemonising after possible errors

Luigi Rizzo rizzo at icir.org
Fri Dec 8 10:23:54 MST 2006


On Fri, Dec 08, 2006 at 05:48:10PM +0100, Martin Vít wrote:
> Jared Smith wrote:
> > On 12/7/06, Tzafrir Cohen <tzafrir.cohen at xorcom.com> wrote:
> >> > Something that I find bothering when I try to debug Asterisk is 
> >> that it
> >> > deamonizes before most errors can occour. It will fork into background
> >> > before many potential fatal errors occour. Such fatal errors are in 
> >> the
> >> > module loading time.
> >
> > Personally, I'm all for this.  One of the most common problems I see
> > (especially when teaching Asterisk classes) is that people
> > misconfigure the signalling (or misnumber their channels) in
> > zapata.conf and Asterisk starts, forks to the background, and then
> > fails.  It would be quite helpful if it loaded the modules first
> > (reporting any errors), and then forked to the background.
> > Unfortunately, I have no idea how hard this would be to implement.
> >
> > Anybody else feel like commenting?
> 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

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.

	cheers
	luigi


More information about the asterisk-dev mailing list