in reply to Re: Re: Starting a process in the background that lives after perl dies.
in thread Starting a process in the background that lives after perl dies.
perlipc has some stuff you may want to try :
Complete Dissociation of Child from Parent In some cases (starting server processes, for instance) you'll want to + complete dissociate the child process from the parent. The easiest w +ay is to use: use POSIX qw(setsid); setsid() or die "Can't start a new session: $!"; However, you may not be on POSIX. The following process is reported to + work on most Unixish systems. Non-Unix users should check their Your +_OS::Process module for other solutions. * Open /dev/tty and use the TIOCNOTTY ioctl on it. See tty(4) for +details. * Change directory to / * Reopen STDIN, STDOUT, and STDERR so they're not connected to the + old tty. * Background yourself like this: fork && exit; * Ignore hangup signals in case you're running on a shell that doe +sn't automatically no-hup you: $SIG{HUP} = 'IGNORE'; # or whatever you'd like
----Asim, known to some as Woodrow.
Edit: chipmunk 2001-11-08
|
|---|