--- loncom/init.d/loncontrol 2004/12/02 21:16:56 1.22 +++ loncom/init.d/loncontrol 2005/05/26 20:25:00 1.25 @@ -1,5 +1,7 @@ #!/usr/bin/perl # +# $Id: loncontrol,v 1.25 2005/05/26 20:25:00 albertel Exp $ +# # The LearningOnline Network with CAPA # # Copyright Michigan State University Board of Trustees @@ -120,7 +122,7 @@ sub stop_daemon { my ($daemon,$killallname)=@_; my $pidfile="/home/httpd/perl/logs/$daemon.pid"; - printf("%-10s ",$daemon); + printf("%-15s ",$daemon); if (-e $pidfile) { open(PIDFILE,$pidfile); my $daemonpid=; @@ -146,6 +148,7 @@ sub stop_daemon { system("killall -q $killallname"); print(", killed off extraneous processes"); } + unlink($pidfile); print("\n"); } @@ -153,16 +156,16 @@ sub stop_daemon { 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') { + foreach my $daemon ('lonsql','lond','lonc','lonhttpd','lonmemcached') { &stop_daemon($daemon,$daemon); } print 'Starting LON-CAPA client and daemon processes (please be patient)'. "\n"; system("su www -c '/home/httpd/perl/loncron --oldlonc --justcheckdaemons'"); -} elsif (($command eq "restart") or ($command eq "reload")) { +} elsif ($command eq "restart") { print 'Restarting LON-CAPA'."\n"; print 'Ending LON-CAPA client and daemon processes'."\n"; - foreach my $daemon ('lonsql','lond','lonc','lonhttpd') { + foreach my $daemon ('lonsql','lond','lonc','lonhttpd','lonmemcached') { my $killallname=$daemon; if ($daemon eq 'lonc') { $killallname='loncnew'; } &stop_daemon($daemon,$killallname); @@ -172,7 +175,7 @@ if (($command eq "restartold") or ($comm 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') { + foreach my $daemon ('lonsql','lond','lonc','lonhttpd','lonmemcached') { my $killallname=$daemon; if ($daemon eq 'lonc') { $killallname='loncnew'; } &stop_daemon($daemon,$killallname); @@ -190,6 +193,9 @@ if (($command eq "restartold") or ($comm print 'Starting LON-CAPA client and daemon processes (please be patient)'. "\n"; system("su www -c '/home/httpd/perl/loncron --justcheckdaemons'"); +} elsif ($command eq "reload") { + print 'Reload LON-CAPA config files'."\n"; + system("su www -c '/home/httpd/perl/loncron --justreload'"); } elsif ($command eq "status") { $response=`/bin/cat /home/httpd/perl/logs/*.pid 2>&1`; if ($response=~/No such file or directory/) {