Annotation of loncom/init.d/loncontrol, revision 1.4
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: }
27: elsif ($command eq "stop") {
28: print "Stopping LON-CAPA\n";
1.3 harris41 29: print `su -c '/bin/kill \`/bin/cat /home/httpd/perl/logs/*.pid\`' www`;
1.1 harris41 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";
1.3 harris41 34: system("su -c /home/httpd/perl/loncron www");
1.1 harris41 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 {
1.3 harris41 46: print "You need to specify restart|stop|start|status on the command line argument.\n";
1.1 harris41 47: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>