[OpenSIPS-Devel] [OpenSIPS-Users] About daemonizing of opensips

SAMEER KUMAR sameer.kasi200x at gmail.com
Thu Apr 23 20:30:48 CEST 2009


Dear,

Try to open *main.c* in opensips source code and you will find a variable
there dont_fork which is set as per the fork=0 or fork=1 in cfg file or as
per the command line arg -D.

It is my mistake that I had forwarded the message meat for the developer
community to the user community. A user not knowing about the source code of
opensips may not have any idea of what I was trying to say. Kindly accept my
aplogy for the same.


Opensips already as forking capability, but I instead want to have threads
for the same things instead of forking a process.

I apologize once again.


Regards,
Sameer Kumar
B.Tech, Computer Engineering
Institute of Technology,
Nirma University,
Ahmedabad, Gujarat
email: sameer.kasi200x at gmail.com
         05bce032 at nirmauni.ac.in
Phone: +919375220396


On Thu, Apr 23, 2009 at 10:09 PM, Brett Nemeroff <brett at nemeroff.com> wrote:

> I'm not entirely sure what you are doing. OpenSIPS already forks properly.
> Try using fork=yes/no instead. I'm not sure what dont_fork is.. but it's
> awfully confusing (dont_fork=no? what?)
>
> -Brett
>
>
> On Wed, Apr 22, 2009 at 6:44 AM, SAMEER KUMAR <sameer.kasi200x at gmail.com>wrote:
>
>> Dear Sir,
>>
>> 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:
>>
>> 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.
>>
>> 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.
>>
>>
>> Kind guidance is invited.
>> *
>> [root at fbsd52 opensips-1.4.4-tls]# opensips 0 -l udp:10.1.10.86:5060 -D
>>
>>  We will not be forking new daemons
>>
>> After switch the dont_fork is 1
>>
>> You have selected multithreaded mode
>>
>> After loading config file the dont_fork is 1
>>
>> After loading config stream the dont_fork is 1
>>
>> After yyparse and cfg_error checks dont_fork is 0
>>
>> After config_check and check_rls checks dont_fork is 0
>>
>> After print_rl() call dont_fork is 0
>>
>> After print_rl() call dont_fork is 0
>>
>> Before initializing the child_no values dont_fork is 0
>>
>> After initializing the dont_fork is 0
>>
>> After initializing chil_no n tcp_child_no the dont_fork is 0
>> Listening on
>>              udp: 10.1.10.86 [10.1.10.86]:5060
>> Aliases:
>>              udp: fbsd52.example.net:5060
>>
>>
>>  Value of dont_fork jus before the if check: 0
>>
>>  Unfortunately new daemons are being forked... and you can not help it
>> [root at fbsd52 opensips-1.4.4-tls]#
>> *
>>
>> Regards,
>> Sameer Kumar
>> B.Tech, Computer Engineering
>> Institute of Technology,
>> Nirma University,
>> Ahmedabad, Gujarat
>> email: sameer.kasi200x at gmail.com
>>          05bce032 at nirmauni.ac.in
>> Phone: +919375220396
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/devel/attachments/20090424/aede2672/attachment.htm 


More information about the Devel mailing list