[OpenSIPS-Devel] [ opensips-Bugs-3522964 ] OpenSIPS daemonizes even though -D is specified

SourceForge.net noreply at sourceforge.net
Wed May 2 11:52:59 CEST 2012


Bugs item #3522964, was opened at 2012-05-02 02:52
Message generated for change (Tracker Item Submitted) made by nobody
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: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
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!

----------------------------------------------------------------------

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