version 1.24, 2005/02/14 00:29:48
|
version 1.27, 2006/01/28 11:21:42
|
Line 47 $ENV{'BASH_ENV'}="";
|
Line 47 $ENV{'BASH_ENV'}="";
|
# Firewall code is based on the code in FC2 /etc/init.d/ntpd |
# Firewall code is based on the code in FC2 /etc/init.d/ntpd |
my $fw_chain = 'RH-Firewall-1-INPUT'; |
my $fw_chain = 'RH-Firewall-1-INPUT'; |
my $iptables = '/sbin/iptables'; |
my $iptables = '/sbin/iptables'; |
|
if (! -e $iptables) { |
|
$iptables = '/usr/sbin/iptables'; |
|
if (! -e $iptables) { |
|
print("Unable to find iptables command\n"); |
|
} |
|
} |
my $lond_port = 5663; |
my $lond_port = 5663; |
my $lonhttpd_port = 8080; |
my $lonhttpd_port = 8080; |
|
|
Line 128 sub stop_daemon {
|
Line 134 sub stop_daemon {
|
my $daemonpid=<PIDFILE>; |
my $daemonpid=<PIDFILE>; |
chomp($daemonpid); |
chomp($daemonpid); |
kill TERM => $daemonpid; |
kill TERM => $daemonpid; |
sleep 2; |
sleep 1; |
if (kill 0 => $daemonpid) { |
if (kill 0 => $daemonpid) { |
kill KILL => $daemonpid; |
kill KILL => $daemonpid; |
sleep 2; |
sleep 1; |
if (kill 0 => $daemonpid) { |
if (kill 0 => $daemonpid) { |
print("failed to kill"); |
print("failed to kill"); |
} else { |
} else { |
Line 162 if (($command eq "restartold") or ($comm
|
Line 168 if (($command eq "restartold") or ($comm
|
print 'Starting LON-CAPA client and daemon processes (please be patient)'. |
print 'Starting LON-CAPA client and daemon processes (please be patient)'. |
"\n"; |
"\n"; |
system("su www -c '/home/httpd/perl/loncron --oldlonc --justcheckdaemons'"); |
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 'Restarting LON-CAPA'."\n"; |
print 'Ending LON-CAPA client and daemon processes'."\n"; |
print 'Ending LON-CAPA client and daemon processes'."\n"; |
foreach my $daemon ('lonsql','lond','lonc','lonhttpd','lonmemcached') { |
foreach my $daemon ('lonsql','lond','lonc','lonhttpd','lonmemcached') { |
Line 193 if (($command eq "restartold") or ($comm
|
Line 199 if (($command eq "restartold") or ($comm
|
print 'Starting LON-CAPA client and daemon processes (please be patient)'. |
print 'Starting LON-CAPA client and daemon processes (please be patient)'. |
"\n"; |
"\n"; |
system("su www -c '/home/httpd/perl/loncron --justcheckdaemons'"); |
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") { |
} elsif ($command eq "status") { |
$response=`/bin/cat /home/httpd/perl/logs/*.pid 2>&1`; |
$response=`/bin/cat /home/httpd/perl/logs/*.pid 2>&1`; |
if ($response=~/No such file or directory/) { |
if ($response=~/No such file or directory/) { |