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

background processes and parent/child relationships

Thread Next
From:
Edward Peschko
Date:
November 25, 2008 17:19
Subject:
background processes and parent/child relationships
Message ID:
5cfa99000811251532t6730c512pb0964505120b32c5@mail.gmail.com
All,

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About