in reply to Keep a "system" process running if script is prematurely exited?
I believe the child needs to disconnect STDIN, STDOUT and STDERR from the terminal.
use IPC::Open3 qw( open3 ); open(local *TO_CHLD, '<', '/dev/null') or die; open(local *FR_CHLD, '>', '/dev/null') or die; open3('>&TO_CHLD', '<&FR_CHLD', '<&FR_CHLD', 'kedit');
It might also need to call POSIX's setsid. I'm not sure what it does ( but I think it's what later-mentioned disown does ).
Update: It's the other way around. setsid is required, but replacing STDIN, STDOUT and STDERR is probably not.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Keep a "system" process running if script is prematurely exited?
by cdarke (Prior) on Jun 17, 2010 at 08:32 UTC | |
by ikegami (Patriarch) on Jun 17, 2010 at 14:38 UTC | |
by cdarke (Prior) on Jun 17, 2010 at 16:42 UTC | |
by ikegami (Patriarch) on Jun 17, 2010 at 19:52 UTC |