/[pdpsoft]/trunk/nl.nikhef.ndpf.tools/prune_userprocs/bin/prune_userprocs
ViewVC logotype

Diff of /trunk/nl.nikhef.ndpf.tools/prune_userprocs/bin/prune_userprocs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3300 by ronalds, Tue Jul 24 10:18:52 2012 UTC revision 3301 by dennisvd, Mon Aug 10 12:02:43 2020 UTC
# Line 18  $opt_a and do { Line 18  $opt_a and do {
18    open MOMCTL,"$MOMCTL -h localhost -d 0 |" or die "Cannot run momctl: $!\n";    open MOMCTL,"$MOMCTL -h localhost -d 0 |" or die "Cannot run momctl: $!\n";
19    while(<MOMCTL>) {    while(<MOMCTL>) {
20      chomp;      chomp;
21      /sidlist=/  and do { split(/=/); push @ARGV,$_[$#_]; };      /sidlist=/  and do { my @a=split(/=/); push @ARGV,$a[$#a]; };
22    }    }
23    close MOMCTL;    close MOMCTL;
24  };  };
25    
26  foreach ( @lines ) {  foreach ( @lines ) {
27    ! /\d+/ && next;      # remove header from ps -efl, which contains no number (PID!)    ! /\d+/ && next;      # remove header from ps -efl, which contains no number (PID!)
28    chomp; split(/\s+/,$_,15);    chomp; my @a=split(/\s+/,$_,15);
29    $opt_n and ($_[12] =~ /(tty|pts)/) and next;    $opt_n and ($a[12] =~ /(tty|pts)/) and next;
30    ( $_[14] eq "$PBSMOM" ) and $mompid=$_[3];    ( $a[14] eq "$PBSMOM" ) and $mompid=$a[3];
31    $children{$_[4]}.=" $_[3]";    $children{$a[4]}.=" $a[3]";
32    $name{$_[3]} = $_[14];    $name{$a[3]} = $a[14];
33    $owner{$_[3]} = (getpwnam($_[2]))[2];    $owner{$a[3]} = (getpwnam($a[2]))[2];
34  }  }
35    
36  @ARGV[0] or push @ARGV,$mompid;  @ARGV[0] or push @ARGV,$mompid;

Legend:
Removed from v.3300  
changed lines
  Added in v.3301

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28