[Users] Question about forking

Tim Madorma tmadorma at gmail.com
Wed May 16 18:01:34 CEST 2007


Hey Anatoly,

I've been running with your patch and it works, but there is one issue
that I want to bring up. After openser forks, it creates processes as
follows:

sipproxy 29745 29743   0 11:32:38 pts/2       0:00 openser -D
sipproxy 29751 29743   0 11:32:38 pts/2       0:00 openser -D
sipproxy 29748 29743   0 11:32:38 pts/2       0:00 openser -D
sipproxy 29750 29743   0 11:32:38 pts/2       0:00 openser -D
sipproxy 29743 29432   0 11:32:37 pts/2       0:00 openser -D
sipproxy 29752 29743   0 11:32:38 pts/2       0:00 openser -D
sipproxy 29744 29743   0 11:32:38 pts/2       0:00 openser -D
sipproxy 29746 29743   0 11:32:38 pts/2       0:00 openser -D
sipproxy 29749 29743   0 11:32:38 pts/2       0:00 openser -D
sipproxy 29747 29744   0 11:32:38 pts/2       0:00 openser -D

You can note that the parent PID is 29743 and has several children,
but for some reason, process 29744 also spawns the child process
29747. When I use runsv to start the process, it notes the process
that it creates is 29743. Then when I terminate with runsv, it kills
29743 - which kills all of it's children, but leaves PID 29747
running. Since it's parent was killed, PID 29747 is adopted by the
init process (PID 1). Here is an example of this done by hand (with a
kill of 29743):

root at homer:/# kill 29743
root at homer:/# ps -ef | grep openser
    root 29756 29266   0 11:35:19 pts/1       0:00 grep openser
sipproxy 29747     1   0 11:32:38 pts/2       0:00 openser -D

Please let me know if you can assist here.

thanks much,
Tim

On 5/7/07, Anatoly Pidruchny <apidruchny at newxt.com> wrote:
> Hi, Tim,
>
> there is a patch (that I submitted) that allows to run the main openser
> process in foreground and fork child processes as usual. No developer
> has reviewed the patch yet. I hope this patch will be accepted soon. The
> patch is simple and we use it for a long time now. You can also take the
> patch and use it.
>
> The patch is:
> http://sourceforge.net/tracker/index.php?func=detail&aid=1689998&group_id=139143&atid=743022
>
> Anatoly
> > Hi,
> >
> > I want to start openser with runsv which requires that the starting
> > process run in the foreground. My problem is that I also want to
> > listen on a couple of different ports. When I set forking = yes, it
> > will listen on multiple ports, but runsv won't work. When I set
> > forking=no, then openser will only listen on the first specified port.
> >
> > Is there any way around this? Can I have the starting process run in
> > the foreground and fork other processes that listen to the ports in
> > the background?
> >
> > Here is the error message:
> >
> > WARNING: no fork mode  and more than one listen address found(will use
> > only the the first one)
> >
> > Here are the associated configuration lines:
> >
> > fork=no
> >
> > children=32
> >
> > # Local IP address/port pairs to listen to
> > listen=65.185.233.55:5061
> > listen=65.185.233.55:5062
> >
> > # Alias IP address/port pairs
> > alias=65.185.233.104:5061
> > alias=65.185.233.104:5062
> >
> > thanks,
> > Tim
> >
> > _______________________________________________
> > Users mailing list
> > Users at openser.org
> > http://openser.org/cgi-bin/mailman/listinfo/users
> >
>
>




More information about the Users mailing list