version 1.41, 2010/12/30 18:40:38
|
version 1.44, 2015/09/20 18:31:33
|
Line 43
|
Line 43
|
# Required-Start: SuSEfirewall2_setup mysql apache2 $network $remote_fs |
# Required-Start: SuSEfirewall2_setup mysql apache2 $network $remote_fs |
# Should-Start: $ALL |
# Should-Start: $ALL |
# Required-Stop: |
# Required-Stop: |
# Default-Start: 3 4 5 |
# Default-Start: 3 5 |
# Default-Stop: |
# Default-Stop: |
# Description: Starts the LON-CAPA services |
# Description: Starts the LON-CAPA services |
### END INIT INFO |
### END INIT INFO |
Line 107 sub clean_sockets {
|
Line 107 sub clean_sockets {
|
} |
} |
} |
} |
|
|
if ($command eq "restart") { |
if (($command eq "restart") || ($command eq 'stop') || |
print 'Restarting LON-CAPA'."\n"; |
($command eq 'start') || ($command eq "status")) { |
print 'Ending LON-CAPA client and daemon processes'."\n"; |
|
foreach my $daemon ('lonsql','lond','lonc','lonmemcached','lonmaxima','lonr') { |
|
my $killallname=$daemon; |
|
if ($daemon eq 'lonc') { $killallname='loncnew'; } |
|
&stop_daemon($daemon,$killallname); |
|
} |
|
print 'Starting LON-CAPA client and daemon processes (please be patient)'. |
|
"\n"; |
|
system("su www -c '/home/httpd/perl/loncron --justcheckdaemons'"); |
|
} elsif (($command eq "stop") || ($command eq 'start') || ($command eq 'status')) { |
|
my $iptables = &LONCAPA::Firewall::get_pathto_iptables(); |
my $iptables = &LONCAPA::Firewall::get_pathto_iptables(); |
my @fw_chains = &LONCAPA::Firewall::get_fw_chains($iptables); |
my @fw_chains = &LONCAPA::Firewall::get_fw_chains($iptables); |
my $lond_port = &LONCAPA::Firewall::get_lond_port(); |
my $lond_port = &LONCAPA::Firewall::get_lond_port(); |
my %iphost; |
my %iphost; |
if ($command eq 'stop') { |
if ($command eq 'restart') { |
|
print 'Restarting LON-CAPA'."\n"; |
|
print 'Ending LON-CAPA client and daemon processes'."\n"; |
|
foreach my $daemon ('lonsql','lond','lonc','lonmemcached','lonmaxima','lonr') { |
|
my $killallname=$daemon; |
|
if ($daemon eq 'lonc') { $killallname='loncnew'; } |
|
&stop_daemon($daemon,$killallname); |
|
} |
|
%iphost = &Apache::lonnet::get_iphost('',1); |
|
my $firewall_result = |
|
&LONCAPA::Firewall::firewall_close_port($iptables,\@fw_chains, |
|
$lond_port,\%iphost,[$lond_port]); |
|
if ($firewall_result) { |
|
print "$firewall_result\n"; |
|
} |
|
$firewall_result = |
|
&LONCAPA::Firewall::firewall_open_port($iptables,\@fw_chains, |
|
$lond_port, \%iphost,[$lond_port]); |
|
if (($firewall_result eq 'ok') || ($firewall_result eq 'inactive firewall')) { |
|
if ($firewall_result eq 'inactive firewall') { |
|
print "WARNING: iptables firewall is currently inactive\n"; |
|
} |
|
} elsif ($firewall_result) { |
|
print "$firewall_result\n"; |
|
} |
|
print 'Starting LON-CAPA client and daemon processes (please be patient)'. |
|
"\n"; |
|
system("su www -c '/home/httpd/perl/loncron --justcheckdaemons'"); |
|
} elsif ($command eq 'stop') { |
print 'Stopping LON-CAPA'."\n"; |
print 'Stopping LON-CAPA'."\n"; |
foreach my $daemon ('lonsql','lond','lonc','lonmemcached','lonmaxima','lonr') { |
foreach my $daemon ('lonsql','lond','lonc','lonmemcached','lonmaxima','lonr') { |
my $killallname=$daemon; |
my $killallname=$daemon; |
Line 137 if ($command eq "restart") {
|
Line 155 if ($command eq "restart") {
|
} |
} |
&clean_sockets(); |
&clean_sockets(); |
} elsif ($command eq "start") { |
} elsif ($command eq "start") { |
%iphost = &Apache::lonnet::get_iphost(); |
%iphost = &Apache::lonnet::get_iphost('',1); |
my $firewall_result = |
my $firewall_result = |
&LONCAPA::Firewall::firewall_open_port($iptables,\@fw_chains,$lond_port,\%iphost,[$lond_port]); |
&LONCAPA::Firewall::firewall_open_port($iptables,\@fw_chains,$lond_port,\%iphost,[$lond_port]); |
if (($firewall_result eq 'ok') || ($firewall_result eq 'inactive firewall')) { |
if (($firewall_result eq 'ok') || ($firewall_result eq 'inactive firewall')) { |