summaryrefslogtreecommitdiff
path: root/Tools/portbuild
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2003-01-24 05:05:38 +0000
committerKris Kennaway <kris@FreeBSD.org>2003-01-24 05:05:38 +0000
commitb60d2dcc1e9f2cd9eb99b88a0bba61fad85c6b10 (patch)
tree26b18d05ead8554f73a431058d07bf0f9eb0d42e /Tools/portbuild
parent- Use ${arch} and rename html files accordingly (diff)
These scripts have been replaced by .c versions that do not require perl.
Notes
Notes: svn path=/head/; revision=73926
Diffstat (limited to 'Tools/portbuild')
-rwxr-xr-xTools/portbuild/scripts/pnohang70
-rwxr-xr-xTools/portbuild/scripts/ptimeout41
2 files changed, 0 insertions, 111 deletions
diff --git a/Tools/portbuild/scripts/pnohang b/Tools/portbuild/scripts/pnohang
deleted file mode 100755
index acfeab8a22b1..000000000000
--- a/Tools/portbuild/scripts/pnohang
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/perl
-# pnohang: executes command ($4-) with output in file ($3)
-# kills command if no output within $1 seconds with message in $2
-# usage: pnohang timeout file command args ...
-
-require "ctime.pl";
-
-if ($#ARGV < 3) {
- print "usage: pnohang timeout outfile message command [args...]\n";
- exit 1;
-}
-
-$timeout=$ARGV[0];
-$outfile=$ARGV[1];
-$message=$ARGV[2];
-splice(@ARGV, 0, 3);
-$pid=$$;
-#print "timeout is ", $timeout, "\n";
-#print "outfile is ", $outfile, "\n";
-#print "message is ", $message, "\n";
-#print "arguments are ", "@ARGV", "\n";
-if ($pid1 = fork) {
- if ($pid2 = fork) {
- local $SIG{TERM} = 'IGNORE';
- # parent
- #print 'child pids are ', $pid1, ' ', $pid2, "\n";
- $child=wait;
- $status=$?;
- #print "exited child is $child, status is $status\n";
- if ($pid1 = $child) {
- #print "killing process $pid2 (second child)\n";
- kill 'TERM', $pid2;
- }
- else {
- #print "killing process $pid1 (first child)\n";
- kill 'TERM', $pid1;
- }
- # exit status in upper 8 bits, killed signal (if any) in lower 8 bits
- exit (($status >> 8) | ($status & 0xff)) ;
- }
- else {
- # second child
- for (;;) {
- #local $^W = 0;
- $now = time;
- sleep $timeout;
- ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks)
- = stat($outfile);
- if ($now > $mtime) {
-# system "logger -t pnohang killing @ARGV $message, pid $pid since no output in $timeout seconds";
- print "pnohang: killing @ARGV ($message, pid $pid1 and $pid) since no output in $timeout seconds since ", &ctime($now);
- print "ps jgx before the signal\n";
- system "ps jgxww";
- sleep 1; # give it a chance to output message
- kill 'TERM' => -$pid1;
- sleep 1;
- kill 'TERM' => -$pid;
- sleep 1;
- print "ps jgx after the signal\n";
- system "ps jgxww";
- exit 1;
- }
- }
- }
-}
-else {
- # first child
- #print "executing @ARGV\n";
- exec "@ARGV >$outfile 2>&1";
-}
diff --git a/Tools/portbuild/scripts/ptimeout b/Tools/portbuild/scripts/ptimeout
deleted file mode 100755
index d4f3a19f24b2..000000000000
--- a/Tools/portbuild/scripts/ptimeout
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/perl -w
-# ptimeout: executes command but kills it after a specified timeout
-# usage: ptimeout timeout command args ...
-
-require "ctime.pl";
-
-$timeout=$ARGV[0];
-splice(@ARGV, 0, 1);
-#print "timeout is ", $timeout, "\n";
-#print "arguments are ", "@ARGV", "\n";
-if ($pid1 = fork) {
- if ($pid2 = fork) {
- # parent
- #print 'child pids are ', $pid1, ' ', $pid2, "\n";
- $child=wait;
- $status=$?;
- #print "exited child is $child, status is $status\n";
- if ($pid1 = $child) {
- #print "killing process $pid2\n";
- kill 'TERM', $pid2;
- }
- else {
- #print "killing process $pid1\n";
- kill 'TERM', $pid1;
- }
- # exit status in upper 8 bits, killed signal (if any) in lower 8 bits
- exit (($status >> 8) | ($status & 0xff)) ;
- }
- else {
- # second child
- sleep $timeout;
- print "ptimeout: killing @ARGV (pid $pid1) since timeout of $timeout expired at ", &ctime(time);
- kill 'TERM', $pid1;
- exit 1;
- }
-}
-else {
- # first child
- #print "executing @ARGV\n";
- exec @ARGV;
-}