Annotation of loncom/init.d/loncontrol, revision 1.3
1.1 harris41 1: #!/usr/bin/perl
1.2 harris41 2: #
3: # Startup script for the LON-CAPA network processes
4: # Scott Harrison 10/25/2000
5: #
1.3 ! harris41 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.
1.2 harris41 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:
1.1 harris41 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";
1.3 ! harris41 23: print `su -c '/bin/kill \`/bin/cat /home/httpd/perl/logs/*.pid\`' www`;
1.1 harris41 24: print "Starting LON-CAPA client and daemon processes (please be patient)\n";
1.3 ! harris41 25: system("su -c '/home/httpd/perl/loncron' www");
1.1 harris41 26: print "Restarting web server\n";
27: print `/etc/rc.d/init.d/httpd restart`;
28: }
29: elsif ($command eq "stop") {
30: print "Stopping LON-CAPA\n";
1.3 ! harris41 31: print `su -c '/bin/kill \`/bin/cat /home/httpd/perl/logs/*.pid\`' www`;
1.1 harris41 32: print "Stopping web server\n";
33: print `/etc/rc.d/init.d/httpd stop`;
34: }
35: elsif ($command eq "start") {
36: print "Starting LON-CAPA\n";
37: print "Starting LON-CAPA client and daemon processes (please be patient)\n";
1.3 ! harris41 38: system("su -c /home/httpd/perl/loncron www");
1.1 harris41 39: print "Starting web server\n";
40: print `/etc/rc.d/init.d/httpd start`;
41: }
42: elsif ($command eq "status") {
43: $response=`/bin/cat /home/httpd/perl/logs/*.pid 2>&1`;
44: if ($response=~/No such file or directory/) {
45: print "LON-CAPA is not running.\n";
46: }
47: else {
48: print "LON-CAPA is running.\n";
49: }
50: }
51: else {
1.3 ! harris41 52: print "You need to specify restart|stop|start|status on the command line argument.\n";
1.1 harris41 53: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>