Ignore SIGPIPE *only* for user programs
[gruntmaster-daemon.git] / gruntmaster-exec
index b1bcd61bf86fab3496a6b05aa2a0c7a5f249bc22..b6577f4649206fee2e1cd108b6ec62cce581d8f1 100755 (executable)
@@ -66,7 +66,7 @@ if ($ret) {
        my $signame = sig_name $sig;
        exit !say TLE,  "\nTime Limit Exceeded"   if $tle;
        exit !say OLE,  "\nOutput Limit Exceeded" if $sig && $signame eq 'XFSZ';
        my $signame = sig_name $sig;
        exit !say TLE,  "\nTime Limit Exceeded"   if $tle;
        exit !say OLE,  "\nOutput Limit Exceeded" if $sig && $signame eq 'XFSZ';
-       exit !say DIED, "\nCrash (SIG$signame)"   if $sig && $signame ne 'PIPE';
+       exit !say DIED, "\nCrash (SIG$signame)"   if $sig && ($signame ne 'PIPE' || $ARGV[0] !~ /prog/);
        exit !say NZX,  "\nNon-zero exit status: " . ($? >> 8) if $? >> 8;
        exit !say AC,   "\nAll OK";
 } else {
        exit !say NZX,  "\nNon-zero exit status: " . ($? >> 8) if $? >> 8;
        exit !say AC,   "\nAll OK";
 } else {
@@ -88,6 +88,9 @@ if ($ret) {
        setrlimit RLIMIT_AS, $mlimit, $mlimit or die $! if $mlimit;
        setrlimit RLIMIT_FSIZE, $olimit, $olimit or die $! if $olimit;
        setrlimit RLIMIT_NPROC, $nproc, $nproc or die $! if $sudo;
        setrlimit RLIMIT_AS, $mlimit, $mlimit or die $! if $mlimit;
        setrlimit RLIMIT_FSIZE, $olimit, $olimit or die $! if $olimit;
        setrlimit RLIMIT_NPROC, $nproc, $nproc or die $! if $sudo;
+       open my $adj, '>', '/proc/self/oom_score_adj';
+       print $adj 900;
+       close $adj;
        unshift @ARGV, @sudo;
        say STDERR "Executing: ", join ' ', map { "'$_'" } @ARGV if $debug;
        exec @ARGV;
        unshift @ARGV, @sudo;
        say STDERR "Executing: ", join ' ', map { "'$_'" } @ARGV if $debug;
        exec @ARGV;
This page took 0.009819 seconds and 4 git commands to generate.