[LON-CAPA-cvs] cvs: doc /loncapafiles ntpcheck.piml
raeburn
raeburn at source.lon-capa.org
Sat Feb 9 11:55:14 EST 2019
raeburn Sat Feb 9 16:55:14 2019 EDT
Modified files:
/doc/loncapafiles ntpcheck.piml
Log:
- Support SLES15 (uses chronyd instead of ntpd).
Index: doc/loncapafiles/ntpcheck.piml
diff -u doc/loncapafiles/ntpcheck.piml:1.33 doc/loncapafiles/ntpcheck.piml:1.34
--- doc/loncapafiles/ntpcheck.piml:1.33 Tue Jun 19 12:26:32 2018
+++ doc/loncapafiles/ntpcheck.piml Sat Feb 9 16:55:14 2019
@@ -3,7 +3,7 @@
<!-- ntpcheck.piml -->
<!-- Matthew Hall -->
-<!-- $Id: ntpcheck.piml,v 1.33 2018/06/19 12:26:32 raeburn Exp $ -->
+<!-- $Id: ntpcheck.piml,v 1.34 2019/02/09 16:55:14 raeburn Exp $ -->
<!--
@@ -38,6 +38,7 @@
print "Checking to be sure the Network Time Protocol is running properly.\n";
print "For more information on ntpd please see http://www.ntp.org/\n";
my $NTPD;
+my $name = 'ntp';
my $checkcmd = 'ps -ef |grep ntp |grep -v grep |grep -v ntpcheck';
my $startntpcmd;
my $is_running;
@@ -50,14 +51,18 @@
('<DIST />' eq 'fedora27') || ('<DIST />' eq 'fedora28') ||
('<DIST />' eq 'centos7') || ('<DIST />' eq 'rhes7') ||
('<DIST />' eq 'scientific7') || ('<DIST />' eq 'sles12') ||
- ('<DIST />' eq 'ubuntu18')) {
+ ('<DIST />' eq 'sles15') || ('<DIST />' eq 'ubuntu18')) {
$NTPD = 'ntpd';
if ('<DIST />' eq 'ubuntu18') {
$NTPD = 'ntp';
+ } elsif ('<DIST />' eq 'sles15') {
+ $NTPD = 'chronyd';
+ $name = $NTPD;
}
+ $checkcmd = "systemctl is-enabled $NTPD.service";
$startntpcmd = "systemctl start $NTPD.service";
if (!-e "/usr/sbin/$NTPD") {
- print "ntp is not installed.\n";
+ print "$name is not installed.\n";
exit;
}
} else {
@@ -79,12 +84,16 @@
chomp($is_running);
close(PIPE);
if (!$is_running) {
- print "WARNING: ntp is installed but is not currently running.\nPlease verify the configuration of ntp in /etc/ntp.conf and /etc/ntp/step-tickers\nStart ntp by executing\n $startntpcmd\n";
+ print "WARNING: $name is installed but is not currently running.\n";
+ if ($name eq 'ntp') {
+ print "Please verify the configuration of ntp in /etc/ntp.conf and /etc/ntp/step-tickers\n";
+ }
+ print "Start $name by executing\n $startntpcmd\n";
} else {
- print "ntp is installed and running\n";
+ print "$name is installed and running\n";
}
} else {
- print "Could not determine ntp status.\n";
+ print "Could not determine $name status.\n";
}
# chkconfig barfs to stderr if the target isn't set up right.
@@ -96,8 +105,8 @@
('<DIST />' eq 'fedora25') || ('<DIST />' eq 'fedora26') ||
('<DIST />' eq 'fedora27') || ('<DIST />' eq 'fedora28') ||
('<DIST />' eq 'centos7') || ('<DIST />' eq 'rhes7') ||
- ('<DIST />' eq 'scientific7') || ('<DIST />' eq 'sles12') ||
- ('<DIST />' eq 'ubuntu18')) {
+ ('<DIST />' eq 'scientific7') || ('<DIST />' eq 'sles12') ||
+ ('<DIST />' eq 'sles15') || ('<DIST />' eq 'ubuntu18')) {
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";
}
More information about the LON-CAPA-cvs
mailing list