--- loncom/init.d/loncontrol 2003/09/16 21:01:39 1.11 +++ loncom/init.d/loncontrol 2004/05/11 21:22:04 1.18 @@ -48,7 +48,7 @@ sub stop_daemon { print("not running\n"); } -if (($command eq "restart") or ($command eq "reload")) { +if (($command eq "restartold") or ($command eq "reloadold")) { print 'Restarting LON-CAPA'."\n"; print 'Ending LON-CAPA client and daemon processes'."\n"; foreach my $daemon ('lonsql','lond','lonc','lonhttpd') { @@ -56,30 +56,39 @@ if (($command eq "restart") or ($command } print 'Starting LON-CAPA client and daemon processes (please be patient)'. "\n"; - system("su -c '/home/httpd/perl/loncron' www"); -} -elsif ($command eq "stop") { + system("su www -c '/home/httpd/perl/loncron --oldlonc --justcheckdaemons'"); +} elsif (($command eq "restart") or ($command eq "reload")) { + print 'Restarting LON-CAPA'."\n"; + print 'Ending LON-CAPA client and daemon processes'."\n"; + foreach my $daemon ('lonsql','lond','lonc','lonhttpd') { + &stop_daemon($daemon); + } + print 'Starting LON-CAPA client and daemon processes (please be patient)'. + "\n"; + system("su www -c '/home/httpd/perl/loncron --justcheckdaemons'"); +} elsif ($command eq "stop") { print 'Stopping LON-CAPA'."\n"; foreach my $daemon ('lonsql','lond','lonc','lonhttpd') { &stop_daemon($daemon); } -} -elsif ($command eq "start") { +} elsif ($command eq "startold") { print 'Starting LON-CAPA'."\n"; print 'Starting LON-CAPA client and daemon processes (please be patient)'. "\n"; - system("su -c '/home/httpd/perl/loncron' www"); -} -elsif ($command eq "status") { + system("su www -c '/home/httpd/perl/loncron --oldlonc --justcheckdaemons'"); +} elsif ($command eq "start") { + print 'Starting LON-CAPA'."\n"; + print 'Starting LON-CAPA client and daemon processes (please be patient)'. + "\n"; + system("su www -c '/home/httpd/perl/loncron --justcheckdaemons'"); +} elsif ($command eq "status") { $response=`/bin/cat /home/httpd/perl/logs/*.pid 2>&1`; if ($response=~/No such file or directory/) { print 'LON-CAPA is not running.'."\n"; - } - else { + } else { print 'LON-CAPA is running.'."\n"; + system("su www -c '/home/httpd/perl/loncron --justcheckconnections'"); } -} -else { - print 'You need to specify restart|stop|start|status on the command line'. - ' argument.'."\n"; +} else { + print 'You need to specify one of restart|stop|start|status on the command line.'."\n"; }