lib/scripts/system.pl
author wenzelm
Sat, 10 Jan 2009 21:32:30 +0100
changeset 29435 a5f84ac14609
parent 29145 b1c6f4563df7
child 34197 aecdcaaa8ff3
permissions -rw-r--r--
added parallel_proofs flag (default true, cf. usedir option -Q), which can be disabled in low-memory situations;

#
# Author: Makarius
#
# system.pl - invoke shell command line (with robust signal handling)
#

# args

($group, $script_name, $pid_name, $output_name) = @ARGV;


# process id

if ($group eq "group") {
  use POSIX "setsid";
  POSIX::setsid || die $!;
}

open (PID_FILE, ">", $pid_name) || die $!;
print PID_FILE "$$\n";
close PID_FILE;


# exec script

$SIG{'INT'} = "DEFAULT";   #paranoia setting, required for Cygwin
exec qq/exec bash '$script_name' > '$output_name'/;