File:  [LON-CAPA] / loncom / init.d / loncontrol
Revision 1.4: download - view: text, annotated - select for diffs
Fri Oct 27 18:06:00 2000 UTC (23 years, 7 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
remove handling of the /etc/rc.d/init.d/httpd level...
this script just handles lonc/lond processes now

    1: #!/usr/bin/perl
    2: #
    3: # Startup script for the LON-CAPA network processes
    4: # Scott Harrison 10/25/2000
    5: #
    6: # chkconfig: 345 95 5
    7: # description: LON-CAPA is an knowledge network server.  It is used to distribute \
    8: #              knowledge resources and instructional management.
    9: # processnames: lonc, lond, lonsql
   10: # pidfiles: /home/httpd/perl/logs/lon*.pid
   11: # config: /etc/httpd/conf/access.conf
   12: # config: /home/httpd/lonTabs/hosts.tab
   13: # config: /home/httpd/lonTabs/spare.tab
   14: 
   15: $command=$ARGV[0]; $command=~s/[^a-z]//g;
   16: 
   17: $ENV{'PATH'}="/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin";
   18: $ENV{'BASH_ENV'}="";
   19: 
   20: if (($command eq "restart") or ($command eq "reload")) {
   21:     print "Restarting LON-CAPA\n";
   22:     print "Ending LON-CAPA client and daemon processes\n";
   23:     print `su -c '/bin/kill \`/bin/cat /home/httpd/perl/logs/*.pid\`' www`;
   24:     print "Starting LON-CAPA client and daemon processes (please be patient)\n";
   25:     system("su -c '/home/httpd/perl/loncron' www");
   26: }
   27: elsif ($command eq "stop") {
   28:     print "Stopping LON-CAPA\n";
   29:     print `su -c '/bin/kill \`/bin/cat /home/httpd/perl/logs/*.pid\`' www`;
   30: }
   31: elsif ($command eq "start") {
   32:     print "Starting LON-CAPA\n";
   33:     print "Starting LON-CAPA client and daemon processes (please be patient)\n"; 
   34:     system("su -c /home/httpd/perl/loncron www");
   35: }
   36: elsif ($command eq "status") {
   37:     $response=`/bin/cat /home/httpd/perl/logs/*.pid 2>&1`;
   38:     if ($response=~/No such file or directory/) {
   39: 	print "LON-CAPA is not running.\n";
   40:     }
   41:     else {
   42: 	print "LON-CAPA is running.\n";
   43:     }
   44: }
   45: else {
   46:     print "You need to specify restart|stop|start|status on the command line argument.\n";
   47: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>