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; |