I&#39;m not entirely sure what you are doing. OpenSIPS already forks properly.<div><br></div><div>Try using fork=yes/no instead. I&#39;m not sure what dont_fork is.. but it&#39;s awfully confusing (dont_fork=no? what?)</div>

<div><br></div><div>-Brett</div><div><br><br><div class="gmail_quote">On Wed, Apr 22, 2009 at 6:44 AM, SAMEER KUMAR <span dir="ltr">&lt;<a href="mailto:sameer.kasi200x@gmail.com">sameer.kasi200x@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Dear Sir,<br><br>While running opensips I am facing a problem, I am using -D option but still dont_fork variable is not set to 1. The switch case block that reads the command line arguments sets the dont_fork in main.c to 1 but afterwards before the if condition (where daemonize() call is made) it is changed to 0. I have tried lot of debugging statements, I have got the result which I have attached below:<br>



<br>Please can some one explain me why my opensips is always going to dont_fork=0 mode, even if i specify -D as command line arg at the time of starting opensips. <br><br>I am trying to add a multithreading capability in main_loop(). for testing purpose I will pass an arguement 0 or 1 as argv[1], and it will be checked. If argv[1]==1 it will go into the multithreading part. I guess if I am creating one thread per port (on which opensips is supposed to listen), I need not load modules in saperate process, I think I can keep rest of the funcitonality similar as dont_fork mode and jus add the code to create a thread per process as per the link list in si startng at udp_listen or tcp_listen etc.<br>



<br><br>Kind guidance is invited.<br><b><i><br>[root@fbsd52 opensips-1.4.4-tls]# opensips 0 -l udp:<a href="http://10.1.10.86:5060" target="_blank">10.1.10.86:5060</a> -D<br><br> We will not be forking new daemons<br><br>

After switch the dont_fork is 1<br>

<br>You have selected multithreaded mode<br><br>After loading config file the dont_fork is 1<br><br>After loading config stream the dont_fork is 1<br><br>After yyparse and cfg_error checks dont_fork is 0<br><br>After config_check and check_rls checks dont_fork is 0<br>



<br>After print_rl() call dont_fork is 0<br><br>After print_rl() call dont_fork is 0<br><br>Before initializing the child_no values dont_fork is 0<br><br>After initializing the dont_fork is 0<br><br>After initializing chil_no n tcp_child_no the dont_fork is 0<br>



Listening on <br>             udp: 10.1.10.86 [10.1.10.86]:5060<br>Aliases: <br>             udp: <a href="http://fbsd52.example.net:5060" target="_blank">fbsd52.example.net:5060</a><br><br><br> Value of dont_fork jus before the if check: 0<br>



<br> Unfortunately new daemons are being forked... and you can not help it<br>[root@fbsd52 opensips-1.4.4-tls]# <br></i></b><br>
<br clear="all">Regards,<br><font color="#888888">Sameer Kumar<br>B.Tech, Computer Engineering<br>Institute of Technology,<br>Nirma University,<br>Ahmedabad, Gujarat<br>email: <a href="mailto:sameer.kasi200x@gmail.com" target="_blank">sameer.kasi200x@gmail.com</a><br>




          <a href="mailto:05bce032@nirmauni.ac.in" target="_blank">05bce032@nirmauni.ac.in</a><br>Phone: +919375220396<br>
</font><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>