Diff for /doc/loncapafiles/chkconfig.piml between versions 1.1 and 1.11

version 1.1, 2004/12/16 20:14:37 version 1.11, 2010/01/01 04:29:01
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 @runlevels = qw/3 4 5/;
 my $command = $chkconfig_bin.' --list httpd';  my $rlstr = join('',@runlevels);
 my $results = `$command`;  
 if ($results eq '') {  if ('<DIST />' eq 'suse9.3' || '<DIST />' eq 'suse9.2' || '<DIST />' eq 'sles9') {
     print "**** WARNING: httpd is not set to run on boot.$/".      $checker_bin = '/';
         "    Execute the following commands to fix this:".$/.      $webserver = 'apache';
         "        $chkconfig_bin --add httpd".$/.      @runlevels = qw/3 5/;
         "        $chkconfig_bin httpd on".$/;  } elsif ('<DIST />' eq 'sles10' || '<DIST />' eq 'sles11' || '<DIST />' eq 'suse10.1' || '<DIST />' eq 'suse10.2' || '<DIST />' eq 'suse10.3' || '<DIST />' eq 'suse11.1' || '<DIST />' eq 'suse11.2') {
 } else {      $webserver = 'apache2';
     my %httpd_runlevels;  } elsif ('<DIST />' eq 'debian5' ||  '<DIST />' eq 'ubuntu6' ||  '<DIST />' eq 'ubuntu8') {
     for (my $rl = 0;$rl &lt;=6;$rl++) {      $checker_bin = '/usr/sbin/sysv-rc-conf';
         if ($results =~ /$rl:on/) { $httpd_runlevels{$rl}++; }      $webserver = 'apache2';
     }  
     #  
     my $warning;  
     foreach my $rl (qw/3 4 5/) {  
         if (! exists($httpd_runlevels{$rl}) ) {  
             $warning .=   
                "**** WARNING: httpd is not set to run at runlevel $rl".$/;  
         }  
     }  
     if ($warning) {  
         print $warning.  
             "    Execute the following command to fix this:".$/.  
             "        /sbin/chkconfig httpd on ".$/;  
     }  
 }  }
   exit if (! -x $checker_bin);
   
 $command = $chkconfig_bin.' --list loncontrol';  foreach my $service ($webserver,'loncontrol') {
 $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 (qw/3 4 5/) {          }
         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.1  
changed lines
  Added in v.1.11


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