Diff for /doc/loncapafiles/chkconfig.piml between versions 1.7 and 1.8

version 1.7, 2009/07/05 21:23:42 version 1.8, 2009/07/14 12:26:29
Line 1 Line 1
 <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN"   <!DOCTYPE piml PUBLIC "-//TUX/DTD piml 1.0 Final//EN" 
  "http://lpml.sourceforge.net/DTD/piml.dtd">   "http://lpml.sourceforge.net/DTD/piml.dtd">
 <!-- phpcheck.piml -->  <!-- checkconfig.piml -->
 <!-- Matthew Hall -->  <!-- Matthew Hall -->
   
 <!-- $Id$ -->  <!-- $Id$ -->
Line 33  http://www.lon-capa.org/ Line 33  http://www.lon-capa.org/
 <targetroot>/</targetroot>  <targetroot>/</targetroot>
 <files>  <files>
 <file>  <file>
 <target dist="default">/home/httpd/lonUsers</target>  <target dist="default"></target>
 <perlscript mode="fg">  <perlscript mode="fg">
 my $chkconfig_bin = '/sbin/chkconfig';  my $checker_bin = '/sbin/chkconfig';
 exit if (! -x $chkconfig_bin);  my $webserver ='httpd';
   my @services = ('apache2','loncontrol');
 my $webserver = 'httpd';  
 my @runlevels = qw/3 4 5/;  my @runlevels = qw/3 4 5/;
   my $rlstr = join('',@runlevels);
   
 if ('<DIST />' eq 'suse9.3' || '<DIST />' eq 'suse9.2' || '<DIST />' eq 'sles9') {  if ('<DIST />' eq 'suse9.3' || '<DIST />' eq 'suse9.2' || '<DIST />' eq 'sles9') {
       $checker_bin = '/';
     $webserver = 'apache';      $webserver = 'apache';
     @runlevels = qw/3 5/;      @runlevels = qw/3 5/;
 } elsif ('<DIST />' eq 'sles10' || '<DIST />' eq 'suse10.1' || '<DIST />' eq 'suse10.2' || '<DIST />' eq 'suse10.3' || '<DIST />' eq 'suse11.1') {  } elsif ('<DIST />' eq 'sles10' || '<DIST />' eq 'suse10.1' || '<DIST />' eq 'suse10.2' || '<DIST />' eq 'suse10.3' || '<DIST />' eq 'suse11.1') {
     $webserver = 'apache2';      $webserver = 'apache2';
   } elsif ('<DIST />' eq 'debian5' ||  '<DIST />' eq 'ubuntu6' ||  '<DIST />' eq 'ubuntu8') {
       $checker_bin = '/usr/sbin/sysv-rc-conf';
       $webserver = 'apache2';
 }  }
 my $command = $chkconfig_bin.' --list '.$webserver;  exit if (! -x $checker_bin);
 my $results = `$command`;  
 if ($results eq '') {  
     print "**** WARNING: $webserver is not set to run on boot.$/".  
         "    Execute the following commands to fix this:".$/.  
         "        $chkconfig_bin --add $webserver".$/.  
         "        $chkconfig_bin $webserver on".$/;  
 } else {  
     my %httpd_runlevels;  
     for (my $rl = 0;$rl &lt;=6;$rl++) {  
         if ($results =~ /$rl:on/) { $httpd_runlevels{$rl}++; }  
     }  
     #  
     my $warning;  
     foreach my $rl (@runlevels) {  
         if (! exists($httpd_runlevels{$rl}) ) {  
             $warning .=   
                "**** WARNING: $webserver is not set to run at runlevel $rl".$/;  
         }  
     }  
     if ($warning) {  
         print $warning.  
             "    Execute the following command to fix this:".$/.  
             "        /sbin/chkconfig $webserver on ".$/;  
     }  
 }  
   
 $command = $chkconfig_bin.' --list loncontrol';  foreach my $service (@services) {
 $results = `$command`;      my $command = $checker_bin.' --list '.$service;
 if ($results eq '') {      my $results = `$command`;
     print "**** WARNING: loncontrol is not set to run on boot.$/".      if ($results eq '') {
         "    Execute the following commands to fix this:".$/.          print "**** WARNING: $service is not set to run on boot.$/".
         "        $chkconfig_bin --add loncontrol".$/.          "    Execute the following commands to fix this:".$/;
         "        $chkconfig_bin loncontrol on".$/;          unless ('<DIST />' eq 'debian5' ||  '<DIST />' eq 'ubuntu6' ||  '<DIST />' eq 'ubuntu8') {
 } else {               print "        $checker_bin --add $webserver".$/;
     my %loncontrol_runlevels;          }
     for (my $rl = 0;$rl&lt;=6;$rl++) {          print "        $checker_bin --level $rlstr $service on".$/;
         if ($results =~ /$rl:on/) { $loncontrol_runlevels{$rl}++; }      } else {
     }          my %curr_runlevels;
     #          for (my $rl = 0;$rl &lt;=6;$rl++) {
     $warning = '';             if ($results =~ /$rl:on/) { $curr_runlevels{$rl}++; }
     foreach my $rl (@runlevels) {          }
         if (! exists($loncontrol_runlevels{$rl})) {          #
             $warning .=           my $warning;
                 "**** WARNING: loncontrol is not set to run at runlevel $rl\n";          foreach my $rl (@runlevels) {
               if (! exists($curr_runlevels{$rl}) ) {
                   $warning .=
                      "**** WARNING: $service is not set to run at runlevel $rl".$/;
               }
           }
           if ($warning) {
               print $warning.
                     "    Execute the following command to fix this:".$/.
                     "        $checker_bin --level $rlstr $service on".$/;
         }          }
     }  
     if ($warning) {  
         print $warning.  
             "    Execute the following command to fix this:".$/.  
             "        /sbin/chkconfig loncontrol on ".$/;  
     }      }
 }  }
   

Removed from v.1.7  
changed lines
  Added in v.1.8


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