[sr-dev] deamonize.c and the option DSYSLOG_ASYNC Kamailio 1.5

Torben Friese contact at derfriese.com
Fri Nov 20 12:14:39 CET 2009


Hi all,

I have a problem with the DSYSLOG_ASYNC option in the Makefile.defs

If I have set this option I could not longer receive log messages in the
"normal" running mode (forking, debug level=2 stderr = no).

If I set the debug to 9 I receive logging messages, then via 
$kamctl debug 2 
is everything fine. 

If the debug is set to 2 and I run the proxy in foreground I also
receive log messages. 

Any way, I have tried to find out what is going wrong here and found
something in :

daemonize.c

At the end of the daemonize function is a for loop 

int daemonize(int * own_pgid)
.
.
/* close any open file descriptors
  32 is the maximum number of inherited open file descriptors */
for (r=3; r < 32; r++){
	close(r);
}
.
.

The variable "r" is used for the return value of fprintf (Upon
successful return, these functions return the number of characters
printed ..).

At the moment I have no idea why this triggering this error and only for
the DSYSLOG_ASYNC option. 

Furthermore why or for what is this for-loop good ?

Maybe I am totally wrong or off the track but I really want this async
logging.


best regards 

Torben 









More information about the sr-dev mailing list