author | wenzelm |
Sat, 20 Dec 2008 11:55:34 +0100 | |
changeset 29145 | b1c6f4563df7 |
parent 26107 | 4b5e5fc1d11f |
child 34197 | aecdcaaa8ff3 |
permissions | -rw-r--r-- |
1 #
2 # Author: Makarius
3 #
4 # system.pl - invoke shell command line (with robust signal handling)
5 #
7 # args
9 ($group, $script_name, $pid_name, $output_name) = @ARGV;
12 # process id
14 if ($group eq "group") {
15 use POSIX "setsid";
16 POSIX::setsid || die $!;
17 }
19 open (PID_FILE, ">", $pid_name) || die $!;
20 print PID_FILE "$$\n";
21 close PID_FILE;
24 # exec script
26 $SIG{'INT'} = "DEFAULT"; #paranoia setting, required for Cygwin
27 exec qq/exec bash '$script_name' > '$output_name'/;