--- loncom/init.d/loncontrol 2010/03/25 01:37:09 1.39 +++ loncom/init.d/loncontrol 2011/05/13 01:36:30 1.42 @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# $Id: loncontrol,v 1.39 2010/03/25 01:37:09 raeburn Exp $ +# $Id: loncontrol,v 1.42 2011/05/13 01:36:30 raeburn Exp $ # # The LearningOnline Network with CAPA # @@ -40,9 +40,10 @@ # SuSE chkconfig/insserv info ### BEGIN INIT INFO # Provides: loncapa -# Required-Start: mysql apache2 $network $remote_fs +# Required-Start: SuSEfirewall2_setup mysql apache2 $network $remote_fs +# Should-Start: $ALL # Required-Stop: -# Default-Start: 3 4 5 +# Default-Start: 3 5 # Default-Stop: # Description: Starts the LON-CAPA services ### END INIT INFO @@ -121,7 +122,7 @@ if ($command eq "restart") { my $iptables = &LONCAPA::Firewall::get_pathto_iptables(); my @fw_chains = &LONCAPA::Firewall::get_fw_chains($iptables); my $lond_port = &LONCAPA::Firewall::get_lond_port(); - my %iphost = &Apache::lonnet::get_iphost(); + my %iphost; if ($command eq 'stop') { print 'Stopping LON-CAPA'."\n"; foreach my $daemon ('lonsql','lond','lonc','lonmemcached','lonmaxima','lonr') { @@ -130,12 +131,13 @@ if ($command eq "restart") { &stop_daemon($daemon,$killallname); } my $firewall_result = - &LONCAPA::Firewall::firewall_close_port($iptables,\@fw_chains,$lond_port,[$lond_port]); + &LONCAPA::Firewall::firewall_close_port($iptables,\@fw_chains,$lond_port,\%iphost,[$lond_port]); if ($firewall_result) { print "$firewall_result\n"; } &clean_sockets(); } elsif ($command eq "start") { + %iphost = &Apache::lonnet::get_iphost(); my $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')) { @@ -155,6 +157,7 @@ if ($command eq "restart") { } } } elsif ($command eq "status") { + %iphost = &Apache::lonnet::get_iphost(); my $response=`/bin/cat /home/httpd/perl/logs/*.pid 2>&1`; if ($response=~/No such file or directory/) { print 'LON-CAPA is not running.'."\n";