lib/scripts/system.pl
author wenzelm
Tue, 10 Jun 2008 19:15:16 +0200
changeset 27123 11fcdd5897dd
parent 26107 4b5e5fc1d11f
child 29145 b1c6f4563df7
permissions -rw-r--r--
case_tac/induct_tac: use same declarations as cases/induct;

#
# $Id$
# 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'/;