[JDEV] Parent PID changed, exiting...

Keith Minkler kminkler at jabber.com
Mon Feb 12 14:51:58 CST 2001


On Mon, Feb 12, 2001 at 01:13:21PM -0600, Thomas Muldowney wrote:
> It's possible that it's legacy code from 1.2, but I'm not sure.  It was missed
> by all of us as jabber.org runs in scripts to capture all the debug output, we
> apologize.
> 
> --temas

this one has to do with linking two jabberd's together.. it was put in as a way
for the child process to know when it is supposed to exit (when the parent process
exits).

you should ONLY be using a <stdout/> flag in a config file that is to be <exec/>'d
inside of another PARENT jabberd.  

There is another section where it checks it's PID, and that is in dnsrv.. a similar
instance is when dnsrv is used, the process forks itself, to run a child dnsrv
module.  This child process also checks it's parent PID to see if it changes to 1,
then exits if it does.

This has worked for some time, and is only meant to happen in those two very distinct
instances.. if you are running a single jabberd, and have a <stdout/> flag inside
of it, then that is WRONG, and you need to take that <stdout/> flag out.. that is
only meant to be used while linking jabberd's together with a config section such as:
<exec>./jabberd/jabberd -c ./jabber2.xml</exec>

Please check your config for errors, thank you!

also, if there is an easier/better way for a child process to check if its parent
has died, I'd love to change this code... I've looked in a lot of places for code
that accomplishes this, with no luck...  this was the best I could do in short notice,
and it fixed all of our "zombie" jabberd problems.

Keith Minkler

> 
> On Mon, Feb 12, 2001 at 09:34:04AM -0800, james rogers wrote:
> > In the jabber-1.4RC/jabberd/base direcrtory in a file called base_stdout.c on line 51 is the function that was added for jabberd version 1.4 (i.e. not found in jabberd 1.2).  This is the function that is needless and causing the server to exit when it's parent process is changed.o
> > 
> > Here it is:
> > 
> > result base_stdout_heartbeat(void *arg)
> > {
> >     static int parent = 0;
> > 
> >     if(parent == 0) parent = getppid();
> > 
> >     if(parent != getppid())
> >     {
> >         /* parent pid has changed, bail */
> >         log_alert("stdout","Parent PID has changed, Server Exiting");
> >         exit(1);
> >     }
> > 
> >     return r_DONE;
> > }
> > 
> > I am guessing that if we change it to the following that we will keep running when we logout of the shell...
> > 
> > result base_stdout_heartbeat(void *arg)
> > {
> >     return r_DONE;
> > }
> > 
> > But before I do this in my own installation...  Why was this check added?  What are we actually checking for here and is there another way to do the same check?
> > 
> > 
> > ___________________________________________________
> > GO.com Mail                                    
> > Get Your Free, Private E-mail at http://mail.go.com
> > 
> > 
> > 
> > _______________________________________________
> > jdev mailing list
> > jdev at jabber.org
> > http://mailman.jabber.org/listinfo/jdev


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20010212/c47bcefa/attachment-0002.pgp>


More information about the JDev mailing list