File:
[LON-CAPA] /
loncom /
init.d /
loncontrol
Revision
1.10:
download - view:
text,
annotated -
select for diffs
Mon Feb 3 18:03:52 2003 UTC (21 years, 6 months ago) by
harris41
Branches:
MAIN
CVS tags:
version_1_0_3,
version_1_0_2,
version_1_0_1,
version_1_0_0,
version_0_99_5,
version_0_99_4,
version_0_99_3,
version_0_99_2,
version_0_99_1,
version_0_99_0,
conference_2003,
HEAD
best wishes to all.
1: #!/usr/bin/perl
2: #
3: # The LearningOnline Network with CAPA
4: #
5: # Startup script for the LON-CAPA network processes
6: #
7: # YEAR=2000
8: # YEAR=2001
9: # YEAR=2002
10:
11: # chkconfig: 345 95 5
12: # description: LON-CAPA is a "network of knowledge". It is used to
13: # distribute knowledge resources and instructional management.
14: # processnames: lonc, lond, lonsql
15: # pidfiles: /home/httpd/perl/logs/lon*.pid
16: # config: /etc/httpd/conf/loncapa.conf
17: # config: /home/httpd/lonTabs/hosts.tab
18: # config: /home/httpd/lonTabs/spare.tab
19:
20: $command=$ARGV[0]; $command=~s/[^a-z]//g;
21:
22: $ENV{'PATH'}="/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin";
23: $ENV{'BASH_ENV'}="";
24:
25: if (($command eq "restart") or ($command eq "reload")) {
26: print 'Restarting LON-CAPA'."\n";
27: print 'Ending LON-CAPA client and daemon processes'."\n";
28: print `su -c '/bin/kill \`/bin/cat /home/httpd/perl/logs/*.pid\`' www`;
29: print 'Starting LON-CAPA client and daemon processes (please be patient)'.
30: "\n";
31: system("su -c '/home/httpd/perl/loncron' www");
32: }
33: elsif ($command eq "stop") {
34: print 'Stopping LON-CAPA'."\n";
35: print `su -c '/bin/kill \`/bin/cat /home/httpd/perl/logs/*.pid\`' www`;
36: }
37: elsif ($command eq "start") {
38: print 'Starting LON-CAPA'."\n";
39: print 'Starting LON-CAPA client and daemon processes (please be patient)'.
40: "\n";
41: system("su -c '/home/httpd/perl/loncron' www");
42: }
43: elsif ($command eq "status") {
44: $response=`/bin/cat /home/httpd/perl/logs/*.pid 2>&1`;
45: if ($response=~/No such file or directory/) {
46: print 'LON-CAPA is not running.'."\n";
47: }
48: else {
49: print 'LON-CAPA is running.'."\n";
50: }
51: }
52: else {
53: print 'You need to specify restart|stop|start|status on the command line'.
54: ' argument.'."\n";
55: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>