develooper Front page | perl.perl5.porters | Postings from November 2008

background processes and parent/child relationships

Thread Next
Edward Peschko
November 25, 2008 17:19
background processes and parent/child relationships
Message ID:

I had a question about system, and how it relates to fork and exec..

Right now, I have processes in scripts of the form:

system("sleep 50000 &");

where, upon forking, the process immediately goes into the background.

This is fine, but it also - by default - *detaches itself from the
parent*, meaning that if i do a ptree on the given process, I no
longer see the parent/child relationships. Which is not so good.

However, if I do:

_system("sleep 50000");

where system is defined as:

sub _system

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About