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:
fprintf(stderr, "daemonizing!\n"); /* debug, inserted by me */
if ( daemonize((log_name==0)?argv:log_name, &own_pgid) <0 )
Invoking it like this:
/usr/sbin/opensips -f /usr/local/etc/opensips/opensips.cfg -P /usr/local/var/run/opensips.pid -D
udp: 192.168.1.3 [192.168.1.3]:5060
udp: 10.0.0.2 [10.0.0.2]:5060
Log in to post a comment.