[LON-CAPA-cvs] cvs: doc /loncapafiles chkconfig.piml

raeburn raeburn@source.lon-capa.org
Thu, 03 Mar 2011 00:10:19 -0000


raeburn		Thu Mar  3 00:10:19 2011 EDT

  Modified files:              
    /doc/loncapafiles	chkconfig.piml 
  Log:
  - Runlevels for web server and loncontrol.
    - scope.
    - correction to run levels for Debian/Ubuntu.
    - explicitly set runlevels to stop services on Debian/Ubuntu.  
  
  
Index: doc/loncapafiles/chkconfig.piml
diff -u doc/loncapafiles/chkconfig.piml:1.14 doc/loncapafiles/chkconfig.piml:1.15
--- doc/loncapafiles/chkconfig.piml:1.14	Tue Mar  1 21:34:28 2011
+++ doc/loncapafiles/chkconfig.piml	Thu Mar  3 00:10:19 2011
@@ -3,7 +3,7 @@
 <!-- checkconfig.piml -->
 <!-- Matthew Hall -->
 
-<!-- $Id: chkconfig.piml,v 1.14 2011/03/01 21:34:28 raeburn Exp $ -->
+<!-- $Id: chkconfig.piml,v 1.15 2011/03/03 00:10:19 raeburn Exp $ -->
 
 <!--
 
@@ -38,7 +38,7 @@
 my $checker_bin = '/sbin/chkconfig';
 my $webserver ='httpd';
 my @runlevels = qw/3 4 5/;
-my $rlstr = join('',@runlevels);
+my @norunlevels = qw/0 1 6/;
 
 if ('<DIST />' eq 'suse9.3' || '<DIST />' eq 'suse9.2' || '<DIST />' eq 'sles9') {
     $checker_bin = '/';
@@ -47,18 +47,24 @@
 } 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' || '<DIST />' eq 'suse11.3' || '<DIST />' eq 'suse11.4') {
     $webserver = 'apache2';
 } elsif ('<DIST />' eq 'debian5' || '<DIST />' eq 'debian6' || '<DIST />' eq 'ubuntu6' ||  '<DIST />' eq 'ubuntu8' || '<DIST />' eq 'ubuntu10') {
+    @runlevels = qw/2 3 4 5/;
+    @norunlevels = qw/0 1 6/;
     $checker_bin = '/usr/sbin/sysv-rc-conf';
     $webserver = 'apache2';
 }
 exit if (! -x $checker_bin);
 
+my $rlstr = join('',@runlevels);
+my $nrlstr = join('',@norunlevels);
 foreach my $service ($webserver,'loncontrol') {
     my $command = $checker_bin.' --list '.$service;
     my $results = `$command`;
     if ($results eq '') {
         print "**** WARNING: $service is not set to run on boot.$/".
         "    Execute the following commands to fix this:".$/;
-        unless ('<DIST />' eq 'debian5' || '<DIST />' eq 'debian6' || '<DIST />' eq 'ubuntu6' ||  '<DIST />' eq 'ubuntu8' '<DIST />' eq 'ubuntu10') {
+        if ('<DIST />' eq 'debian5' || '<DIST />' eq 'debian6' || '<DIST />' eq 'ubuntu6' ||  '<DIST />' eq 'ubuntu8' '<DIST />' eq 'ubuntu10') {
+            print "        $checker_bin --level $nrlstr $service off".$/;
+        } else {
              print "        $checker_bin --add $webserver".$/;
         }
         print "        $checker_bin --level $rlstr $service on".$/;