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

raeburn raeburn@source.lon-capa.org
Tue, 31 May 2011 11:27:24 -0000


raeburn		Tue May 31 11:27:24 2011 EDT

  Modified files:              
    /doc/loncapafiles	ntpcheck.piml 
  Log:
  - "chkconfig --list" not available in fedora15. (systemd replacing sysvinit). 
  
  
Index: doc/loncapafiles/ntpcheck.piml
diff -u doc/loncapafiles/ntpcheck.piml:1.11 doc/loncapafiles/ntpcheck.piml:1.12
--- doc/loncapafiles/ntpcheck.piml:1.11	Sun Feb 27 18:50:50 2011
+++ doc/loncapafiles/ntpcheck.piml	Tue May 31 11:27:24 2011
@@ -3,7 +3,7 @@
 <!-- ntpcheck.piml -->
 <!-- Matthew Hall -->
 
-<!-- $Id: ntpcheck.piml,v 1.11 2011/02/27 18:50:50 raeburn Exp $ -->
+<!-- $Id: ntpcheck.piml,v 1.12 2011/05/31 11:27:24 raeburn Exp $ -->
 
 <!--
 
@@ -60,23 +60,30 @@
 } else {
     $checking_bin = '/sbin/chkconfig';
 }
-$restartchk = `$checking_bin --list $NTPD 2>/dev/null`;
-if ($restartchk eq '') {
-    print "**** WARNING: ntpd is either not installed or not configured to run at boot.\n";
-    exit;
-}
-if ($restartchk =~ /^error reading information on service / ||
-    $restartchk !~ /\d:(on|off)/) {
-    print "**** WARNING: Unable to check status $NTPD with $checking_bin.\n";
-    exit;
-}
-if ($restartchk !~ /\s3:on/) {
-    print "**** WARNING: ntpd is not set to start at runlevel 3.  To correct this run:\n$checking_bin --level 345 $NTPD on\n";
-    exit;
-}
-if ($restartchk !~ /\s5:on/) {
-    print "**** WARNING: ntpd is not set to start at runlevel 5.  To correct this run:\n$checking_bin --level 345 $NTPD on\n";
+if ('<DIST />' eq 'fedora15') {
+    if (!-l "/etc/systemd/system/multi-user.target.wants/ntpd.service") {  
+        print "**** WARNING: ntpd is not configured to run at boot.  To correct this run:\nsystemctl enable ntpd.service\n";
+    }
     exit;
+} else {
+    $restartchk = `$checking_bin --list $NTPD 2>/dev/null`;
+    if ($restartchk eq '') {
+        print "**** WARNING: ntpd is either not installed or not configured to run at boot.\n";
+        exit;
+    }
+    if ($restartchk =~ /^error reading information on service / ||
+        $restartchk !~ /\d:(on|off)/) {
+        print "**** WARNING: Unable to check status $NTPD with $checking_bin.\n";
+        exit;
+    }
+    if ($restartchk !~ /\s3:on/) {
+        print "**** WARNING: ntpd is not set to start at runlevel 3.  To correct this run:\n$checking_bin --level 345 $NTPD on\n";
+        exit;
+    }
+    if ($restartchk !~ /\s5:on/) {
+        print "**** WARNING: ntpd is not set to start at runlevel 5.  To correct this run:\n$checking_bin --level 345 $NTPD on\n";
+        exit;
+    }
 }
 </perlscript>
 </file>