21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
31 We send all sand processes a SIGSTOP when one of our precious files
32 gets lost in the hope that the frozen jobs give us a clue about who
33 was doing what when the files got lost.
39 use lib
"$FindBin::Bin/../lib";
45 use File
::Basename
qw(dirname);
46 use File
::Path
qw(mkpath);
51 use Hash
::Util
qw(lock_keys);
54 lock_keys
%Opt, map { /([^=|!]+)/ } @opt;
62 use POSIX
qw(strftime);
67 /home/sand/.cpanreporter/config.ini
68 /home/sand/.cpanreporter/metabase_id.json
72 for my $f (@PRECIOUS) {
74 my $localtime = localtime;
75 warn "ALERT $localtime: missing file '$f', going to stop all sand/perl programs";
82 open my $fh, "-|", ps
=> "auxww" or die;
84 my($user,$pid,undef,undef,undef,undef,undef,undef,undef,undef,$cmd) = split " ", $_, 11;
85 next unless $user eq "sand";
87 next unless $cmd =~ /perl/;
88 open my $fh2, "<", "/proc/$pid/status" or next;
91 next unless /^VmData:(?:\s+)(\d+) kB/;
92 printf "%s %5d %7d: %s\n", strftime
("%FT%T",localtime), $pid, $1, $cmd;
94 warn "Stopping now $pid\n";
95 kill STOP
=> $pid or die "Could not stop: $!";;
102 # cperl-indent-level: 4