in reply to launch and then exit out of app
You could call exec instead. Actually, the parent only hangs around until its own system call is done. If the child is hanging around, too, it may have gone zombie. Dealing with external apps, you probably will need to set $SIG{CHLD} = 'IGNORE'; (if supported) to avoid the Z's.
Added: to launch some external utilities and exit,
If the apps don't run as daemons, you may need to have them ignore SIGHUP or else call &POSIX::setsid so that the parent's exit doesn't trigger an early demise of the kids.my @apps = ( [qw(/path/to/foo args of foo)], [qw(/path/to/bar args of it here)] ); $SIG{CHLD} = 'IGNORE'; for (@apps) { defined(my $cpid = fork) or die $!; $cpid or exec {$_->[0]} @$_ or die $!; } exit 0; # the parent
After Compline,
Zaxo
|
|---|