Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

RE: Re: I got zombies

by reptile (Monk)
on Aug 08, 2000 at 05:53 UTC ( #26722=note: print w/ replies, xml ) Need Help??


in reply to Re: I got zombies
in thread I got zombies

There is no foreground process. It's using setsid() to disassociate the child from the parent, then the parent exits. The remaining process (the child) forks a process it's the parent of and they both do their own thing.

I should have just left out the setsid() because you're apparently confused by what I intended to do with it. I wasn't sure if it was pretinent or not, so I mentioned it.

I'm doing something like this:

use POSIX qw/setsid/; if ( fork() ) { exit; } else { setsid(); } # now the foreground process is gone and I'm the child if ( fork() ) { &do_something(); } else { &do_something_else(); }

They both stay around in an infinite loop doing whatever they're supposed to do. I have to kill them both or whichever one I don't kill sticks around. Like from ps auxf:

iniquity 26464 0.5 15.9 2976 2348 ? S 21:41 0:00 perl -w ./si +ncd.pl iniquity 26465 0.0 15.4 2920 2276 ? S 21:41 0:00 \_ perl -w +./sincd.p

If I kill 26464, 26465 doesn't go away.

local $_ = "0A72656B636148206C72655020726568746F6E41207473754A"; while(s/..$//) { print chr(hex($&)) }


Comment on RE: Re: I got zombies
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://26722]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2014-08-27 21:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (253 votes), past polls