Can't see process with ps or top
I am using Perl to fork a child process and then use setsid on both processes to make them independent group leaders. It's a very simple command I use to do this...
perl -mPOSIX=setsid -e 'fork;setsid;sleep'
When I do a ps -ef (or top) all I can see is the first process untill I manually kill this one then the child appears.
I've refined it a bit so that now I do...
perl -mPOSIX=setsid -e 'fork;sleep 10;setsid;sleep'
Now when I do a ps -ef I can see both processes for 10 seconds. Then the child process becomes invisible untill I kill the parent, upon which the child process reappears.
At all times I can see the child process directory in /proc. I there some magic switch I've missed on ps?
|