[OpenSIPS-Devel] [ opensips-Bugs-3522964 ] OpenSIPS daemonizes even though -D is specified
SourceForge.net
noreply at sourceforge.net
Thu May 3 10:22:28 CEST 2012
Bugs item #3522964, was opened at 2012-05-02 02:52
Message generated for change (Comment added) made by vladut-paiu
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3522964&group_id=232389
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.7.x
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Vladut-Stefan Paiu (vladut-paiu)
Summary: OpenSIPS daemonizes even though -D is specified
Initial Comment:
When I start OpenSIPS 1.7.2 in the command-line and specify the -D parameter, it detaches from the console anyway. There seems to be a bug somewhere, since I've inserted a printf() in main.c, in the call to daemonize() and it is indeed called, even though I specified -D. So it seems like dont_fork is not properly set or it is corrupted:
if (!dont_fork){
fprintf(stderr, "daemonizing!\n"); /* debug, inserted by me */
if ( daemonize((log_name==0)?argv[0]:log_name, &own_pgid) <0 )
goto error;
}
Invoking it like this:
/usr/sbin/opensips -f /usr/local/etc/opensips/opensips.cfg -P /usr/local/var/run/opensips.pid -D
I get:
Listening on
udp: 192.168.1.3 [192.168.1.3]:5060
udp: 10.0.0.2 [10.0.0.2]:5060
Aliases:
udp: myboxip:5060
udp: myserver:5060
daemonizing!
----------------------------------------------------------------------
>Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2012-05-03 01:22
Message:
Hi,
It seems that in your config file you are specifying 'fork=yes' , so the
dont_fork variable is being overwritten when the cfg is parsed.
I have committed a fix for this in the 1.7, 1.8 and trunk branches.
Regards,
Vlad
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3522964&group_id=232389
More information about the Devel
mailing list