Diff for /loncom/init.d/loncontrol between versions 1.31 and 1.33

version 1.31, 2007/06/02 03:40:02 version 1.33, 2008/11/04 21:06:31
Line 64  $ENV{'BASH_ENV'}=""; Line 64  $ENV{'BASH_ENV'}="";
  }   }
     }      }
     my $lond_port = 5663;      my $lond_port = 5663;
     my $lonhttpd_port = 8080;  
   
 sub firewall_open_port {  sub firewall_open_port {
     return if (! &firewall_is_active);      return if (! &firewall_is_active);
Line 74  sub firewall_open_port { Line 73  sub firewall_open_port {
     # We could restrict the servers allowed to attempt to communicate      # We could restrict the servers allowed to attempt to communicate
     # here, but the logistics of updating the /home/httpd/lonTabs/host.tab      # here, but the logistics of updating the /home/httpd/lonTabs/host.tab
     # file are likely to be a problem      # file are likely to be a problem
     foreach my $port ($lond_port,$lonhttpd_port) {      foreach my $port ($lond_port) {
         print "Opening firewall access on port $port.\n";          print "Opening firewall access on port $port.\n";
   
         my $firewall_command =           my $firewall_command = 
Line 115  sub firewall_is_active { Line 114  sub firewall_is_active {
   
 sub firewall_close_port {  sub firewall_close_port {
     return if (! &firewall_is_active);      return if (! &firewall_is_active);
     foreach my $port ($lond_port,$lonhttpd_port) {      foreach my $port ($lond_port) {
         print "Closing firewall access on port $port.\n";          print "Closing firewall access on port $port.\n";
         my $firewall_command =           my $firewall_command = 
             "$iptables -D $fw_chain -p tcp -d 0/0 --dport $port -j ACCEPT";              "$iptables -D $fw_chain -p tcp -d 0/0 --dport $port -j ACCEPT";
Line 144  sub stop_daemon { Line 143  sub stop_daemon {
  my $daemonpid=<PIDFILE>;   my $daemonpid=<PIDFILE>;
  chomp($daemonpid);   chomp($daemonpid);
  kill TERM => $daemonpid;   kill TERM => $daemonpid;
  sleep 1;   my $count=0;
    while ($count++ < 5 && kill(0 => $daemonpid)) {
       sleep 1;
    }
  if (kill 0 => $daemonpid) {   if (kill 0 => $daemonpid) {
     kill KILL => $daemonpid;      kill KILL => $daemonpid;
     sleep 1;      sleep 1;
Line 180  sub clean_sockets { Line 182  sub clean_sockets {
 if ($command eq "restart") {  if ($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','lonmaxima') {      foreach my $daemon ('lonsql','lond','lonc','lonmemcached','lonmaxima') {
  my $killallname=$daemon;   my $killallname=$daemon;
  if ($daemon eq 'lonc') { $killallname='loncnew'; }   if ($daemon eq 'lonc') { $killallname='loncnew'; }
  &stop_daemon($daemon,$killallname);   &stop_daemon($daemon,$killallname);
Line 190  if ($command eq "restart") { Line 192  if ($command eq "restart") {
     system("su www -c '/home/httpd/perl/loncron --justcheckdaemons'");      system("su www -c '/home/httpd/perl/loncron --justcheckdaemons'");
 } elsif ($command eq "stop") {  } elsif ($command eq "stop") {
     print 'Stopping LON-CAPA'."\n";      print 'Stopping LON-CAPA'."\n";
     foreach my $daemon ('lonsql','lond','lonc','lonhttpd','lonmemcached','lonmaxima') {      foreach my $daemon ('lonsql','lond','lonc','lonmemcached','lonmaxima') {
  my $killallname=$daemon;   my $killallname=$daemon;
  if ($daemon eq 'lonc') { $killallname='loncnew'; }   if ($daemon eq 'lonc') { $killallname='loncnew'; }
  &stop_daemon($daemon,$killallname);   &stop_daemon($daemon,$killallname);

Removed from v.1.31  
changed lines
  Added in v.1.33


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>