version 1.70, 2007/02/02 12:59:13
|
version 1.71, 2007/04/03 00:47:26
|
Line 79 ENDERROUT
|
Line 79 ENDERROUT
|
sub start_daemon { |
sub start_daemon { |
my ($fh,$daemon,$pidfile,$args) = @_; |
my ($fh,$daemon,$pidfile,$args) = @_; |
my $progname=$daemon; |
my $progname=$daemon; |
if ($daemon eq 'lonc' && $args eq 'new') { |
if ($daemon eq 'lonc') { |
$progname='loncnew'; |
$progname='loncnew'; |
print "new "; |
|
} |
} |
my $error_fname="$perlvar{'lonDaemons'}/logs/${daemon}_errors"; |
my $error_fname="$perlvar{'lonDaemons'}/logs/${daemon}_errors"; |
my $size=(stat($error_fname))[7]; |
my $size=(stat($error_fname))[7]; |
Line 602 sub usage {
|
Line 601 sub usage {
|
loncron - housekeeping program that checks up on various parts of Lon-CAPA |
loncron - housekeeping program that checks up on various parts of Lon-CAPA |
|
|
Options: |
Options: |
--help Display help |
--help Display |
--oldlonc When starting the lonc daemon use 'lonc' not 'loncnew' |
|
--noemail Do not send the status email |
--noemail Do not send the status email |
--justcheckconnections Only check the current status of the lonc/d |
--justcheckconnections Only check the current status of the lonc/d |
connections, do not send emails do not |
connections, do not send emails do not |
Line 623 USAGE
|
Line 621 USAGE
|
|
|
# ================================================================ Main Program |
# ================================================================ Main Program |
sub main () { |
sub main () { |
my ($oldlonc,$help,$justcheckdaemons,$noemail,$justcheckconnections, |
my ($help,$justcheckdaemons,$noemail,$justcheckconnections, |
$justreload); |
$justreload); |
&GetOptions("help" => \$help, |
&GetOptions("help" => \$help, |
"oldlonc" => \$oldlonc, |
|
"justcheckdaemons" => \$justcheckdaemons, |
"justcheckdaemons" => \$justcheckdaemons, |
"noemail" => \$noemail, |
"noemail" => \$noemail, |
"justcheckconnections" => \$justcheckconnections, |
"justcheckconnections" => \$justcheckconnections, |
Line 714 sub main () {
|
Line 711 sub main () {
|
if ( &checkon_daemon($fh,'lond',40000,'USR1') eq 'running') { |
if ( &checkon_daemon($fh,'lond',40000,'USR1') eq 'running') { |
&checkon_daemon($fh,'lond',40000,'USR2'); |
&checkon_daemon($fh,'lond',40000,'USR2'); |
} |
} |
my $args='new'; |
&checkon_daemon($fh,'lonc',40000,'USR1'); |
if ($oldlonc) { $args = ''; } |
|
&checkon_daemon($fh,'lonc',40000,'USR1',$args); |
|
&checkon_daemon($fh,'lonhttpd',40000); |
&checkon_daemon($fh,'lonhttpd',40000); |
&checkon_daemon($fh,'lonmemcached',40000); |
&checkon_daemon($fh,'lonmemcached',40000); |
&checkon_daemon($fh,'lonmaxima',40000); |
&checkon_daemon($fh,'lonmaxima',40000); |
} |
} |
if ($justreload) { |
if ($justreload) { |
&checkon_daemon($fh,'lond',40000,'USR2'); |
&checkon_daemon($fh,'lond',40000,'USR2'); |
my $args='new'; |
&checkon_daemon($fh,'lonc',40000,'USR2'); |
if ($oldlonc) { $args = ''; } |
|
&checkon_daemon($fh,'lonc',40000,'USR2',$args); |
|
} |
} |
if ($justcheckconnections) { |
if ($justcheckconnections) { |
&test_connections($fh,\%hostname); |
&test_connections($fh,\%hostname); |