version 1.108, 2003/02/03 18:03:52
|
version 1.113, 2003/03/13 21:01:52
|
Line 263 sub checkchildren {
|
Line 263 sub checkchildren {
|
} |
} |
} |
} |
sleep 5; |
sleep 5; |
|
$SIG{ALRM} = sub { die "timeout" }; |
|
$SIG{__DIE__} = 'DEFAULT'; |
foreach (sort keys %children) { |
foreach (sort keys %children) { |
unless (-e "$docdir/lon-status/londchld/$_.txt") { |
unless (-e "$docdir/lon-status/londchld/$_.txt") { |
|
eval { |
|
alarm(300); |
&logthis('Child '.$_.' did not respond'); |
&logthis('Child '.$_.' did not respond'); |
kill 9 => $_; |
kill 9 => $_; |
$emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; |
$emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; |
$subj="LON: $perlvar{'lonHostID'} killed lond process $_"; |
$subj="LON: $perlvar{'lonHostID'} killed lond process $_"; |
my $result=`echo 'Killed lond process $_.' | mailto $emailto -s '$subj' > /dev/null`; |
my $result=`echo 'Killed lond process $_.' | mailto $emailto -s '$subj' > /dev/null`; |
$execdir=$perlvar{'lonDaemons'}; |
$execdir=$perlvar{'lonDaemons'}; |
$result=`/bin/cp $execdir/logs/lond.log $execdir/logs/lond.log.$_` |
$result=`/bin/cp $execdir/logs/lond.log $execdir/logs/lond.log.$_`; |
|
alarm(0); |
|
} |
} |
} |
} |
} |
|
$SIG{ALRM} = 'DEFAULT'; |
|
$SIG{__DIE__} = \&cathcexception; |
} |
} |
|
|
# --------------------------------------------------------------------- Logging |
# --------------------------------------------------------------------- Logging |
Line 855 sub make_new_child {
|
Line 863 sub make_new_child {
|
$fpnow.='/'.$fpparts[$i]; |
$fpnow.='/'.$fpparts[$i]; |
unless (-e $fpnow) { |
unless (-e $fpnow) { |
unless (mkdir($fpnow,0777)) { |
unless (mkdir($fpnow,0777)) { |
$fperror="error:$!"; |
$fperror="error: ".($!+0) |
|
." mkdir failed while attempting " |
|
."makeuser\n"; |
} |
} |
} |
} |
} |
} |
Line 1026 sub make_new_child {
|
Line 1036 sub make_new_child {
|
print $hfh "$now:$hostid{$clientip}:$what\n"; |
print $hfh "$now:$hostid{$clientip}:$what\n"; |
print $client "ok\n"; |
print $client "ok\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." IO::File->new Failed " |
|
."while attempting log\n"; |
} |
} |
} |
} |
# ------------------------------------------------------------------------- put |
# ------------------------------------------------------------------------- put |
Line 1054 sub make_new_child {
|
Line 1066 sub make_new_child {
|
if (untie(%hash)) { |
if (untie(%hash)) { |
print $client "ok\n"; |
print $client "ok\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) failed ". |
|
"while attempting put\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!) |
|
." tie(GDBM) Failed ". |
|
"while attempting put\n"; |
} |
} |
} else { |
} else { |
print $client "refused\n"; |
print $client "refused\n"; |
Line 1096 sub make_new_child {
|
Line 1112 sub make_new_child {
|
if (untie(%hash)) { |
if (untie(%hash)) { |
print $client "ok\n"; |
print $client "ok\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting rolesput\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting rolesput\n"; |
} |
} |
} else { |
} else { |
print $client "refused\n"; |
print $client "refused\n"; |
Line 1122 sub make_new_child {
|
Line 1142 sub make_new_child {
|
$qresult=~s/\&$//; |
$qresult=~s/\&$//; |
print $client "$qresult\n"; |
print $client "$qresult\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting get\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
if ($!+0 == 2) { |
|
print $client "error:No such file or ". |
|
"GDBM reported bad block error\n"; |
|
} else { |
|
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting get\n"; |
|
} |
} |
} |
# ------------------------------------------------------------------------ eget |
# ------------------------------------------------------------------------ eget |
} elsif ($userinput =~ /^eget/) { |
} elsif ($userinput =~ /^eget/) { |
Line 1158 sub make_new_child {
|
Line 1187 sub make_new_child {
|
print $client "error:no_key\n"; |
print $client "error:no_key\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting eget\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting eget\n"; |
} |
} |
# ------------------------------------------------------------------------- del |
# ------------------------------------------------------------------------- del |
} elsif ($userinput =~ /^del/) { |
} elsif ($userinput =~ /^del/) { |
Line 1186 sub make_new_child {
|
Line 1219 sub make_new_child {
|
if (untie(%hash)) { |
if (untie(%hash)) { |
print $client "ok\n"; |
print $client "ok\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting del\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting del\n"; |
} |
} |
# ------------------------------------------------------------------------ keys |
# ------------------------------------------------------------------------ keys |
} elsif ($userinput =~ /^keys/) { |
} elsif ($userinput =~ /^keys/) { |
Line 1207 sub make_new_child {
|
Line 1244 sub make_new_child {
|
$qresult=~s/\&$//; |
$qresult=~s/\&$//; |
print $client "$qresult\n"; |
print $client "$qresult\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting keys\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting keys\n"; |
} |
} |
# ----------------------------------------------------------------- dumpcurrent |
# ----------------------------------------------------------------- dumpcurrent |
} elsif ($userinput =~ /^currentdump/) { |
} elsif ($userinput =~ /^currentdump/) { |
Line 1248 sub make_new_child {
|
Line 1289 sub make_new_child {
|
chop($qresult); |
chop($qresult); |
print $client "$qresult\n"; |
print $client "$qresult\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting currentdump\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting currentdump\n"; |
} |
} |
# ------------------------------------------------------------------------ dump |
# ------------------------------------------------------------------------ dump |
} elsif ($userinput =~ /^dump/) { |
} elsif ($userinput =~ /^dump/) { |
Line 1282 sub make_new_child {
|
Line 1327 sub make_new_child {
|
chop($qresult); |
chop($qresult); |
print $client "$qresult\n"; |
print $client "$qresult\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting dump\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting dump\n"; |
} |
} |
# ----------------------------------------------------------------------- store |
# ----------------------------------------------------------------------- store |
} elsif ($userinput =~ /^store/) { |
} elsif ($userinput =~ /^store/) { |
Line 1322 sub make_new_child {
|
Line 1371 sub make_new_child {
|
if (untie(%hash)) { |
if (untie(%hash)) { |
print $client "ok\n"; |
print $client "ok\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting store\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting store\n"; |
} |
} |
} else { |
} else { |
print $client "refused\n"; |
print $client "refused\n"; |
Line 1356 sub make_new_child {
|
Line 1409 sub make_new_child {
|
$qresult=~s/\&$//; |
$qresult=~s/\&$//; |
print $client "$qresult\n"; |
print $client "$qresult\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting restore\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting restore\n"; |
} |
} |
# -------------------------------------------------------------------- chatsend |
# -------------------------------------------------------------------- chatsend |
} elsif ($userinput =~ /^chatsend/) { |
} elsif ($userinput =~ /^chatsend/) { |
Line 1398 sub make_new_child {
|
Line 1455 sub make_new_child {
|
print $client "ok\n"; |
print $client "ok\n"; |
} |
} |
else { |
else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." IO::File->new Failed ". |
|
"while attempting queryreply\n"; |
} |
} |
# ----------------------------------------------------------------------- idput |
# ----------------------------------------------------------------------- idput |
} elsif ($userinput =~ /^idput/) { |
} elsif ($userinput =~ /^idput/) { |
Line 1422 sub make_new_child {
|
Line 1481 sub make_new_child {
|
if (untie(%hash)) { |
if (untie(%hash)) { |
print $client "ok\n"; |
print $client "ok\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting idput\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting idput\n"; |
} |
} |
# ----------------------------------------------------------------------- idget |
# ----------------------------------------------------------------------- idget |
} elsif ($userinput =~ /^idget/) { |
} elsif ($userinput =~ /^idget/) { |
Line 1443 sub make_new_child {
|
Line 1506 sub make_new_child {
|
$qresult=~s/\&$//; |
$qresult=~s/\&$//; |
print $client "$qresult\n"; |
print $client "$qresult\n"; |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." untie(GDBM) Failed ". |
|
"while attempting idget\n"; |
} |
} |
} else { |
} else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
." tie(GDBM) Failed ". |
|
"while attempting idget\n"; |
} |
} |
# ---------------------------------------------------------------------- tmpput |
# ---------------------------------------------------------------------- tmpput |
} elsif ($userinput =~ /^tmpput/) { |
} elsif ($userinput =~ /^tmpput/) { |
Line 1463 sub make_new_child {
|
Line 1530 sub make_new_child {
|
print $client "$id\n"; |
print $client "$id\n"; |
} |
} |
else { |
else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
."IO::File->new Failed ". |
|
"while attempting tmpput\n"; |
} |
} |
|
|
# ---------------------------------------------------------------------- tmpget |
# ---------------------------------------------------------------------- tmpget |
Line 1479 sub make_new_child {
|
Line 1548 sub make_new_child {
|
close $store; |
close $store; |
} |
} |
else { |
else { |
print $client "error:$!\n"; |
print $client "error: ".($!+0) |
|
."IO::File->new Failed ". |
|
"while attempting tmpget\n"; |
} |
} |
|
|
|
# ---------------------------------------------------------------------- tmpdel |
|
} elsif ($userinput =~ /^tmpdel/) { |
|
my ($cmd,$id)=split(/:/,$userinput); |
|
chomp($id); |
|
$id=~s/\W/\_/g; |
|
my $execdir=$perlvar{'lonDaemons'}; |
|
if (unlink("$execdir/tmp/$id.tmp")) { |
|
print $client "ok\n"; |
|
} else { |
|
print $client "error: ".($!+0) |
|
."Unlink tmp Failed ". |
|
"while attempting tmpdel\n"; |
|
} |
# -------------------------------------------------------------------------- ls |
# -------------------------------------------------------------------------- ls |
} elsif ($userinput =~ /^ls/) { |
} elsif ($userinput =~ /^ls/) { |
my ($cmd,$ulsdir)=split(/:/,$userinput); |
my ($cmd,$ulsdir)=split(/:/,$userinput); |