bab9bb6b69
Create new directories: ceph config config-files filesystem kernel kernel/kernel-modules ldap logging strorage-drivers tools utilities virt Retire directories: connectivity core devtools support extended Delete two packages: tgt irqbalance Relocated packages: base/ dhcp initscripts libevent lighttpd linuxptp memcached net-snmp novnc ntp openssh pam procps sanlock shadow sudo systemd util-linux vim watchdog ceph/ python-cephclient config/ facter puppet-4.8.2 puppet-modules filesystem/ e2fsprogs nfs-utils nfscheck kernel/ kernel-std kernel-rt kernel/kernel-modules/ mlnx-ofa_kernel ldap/ nss-pam-ldapd openldap logging/ syslog-ng logrotate networking/ lldpd iproute mellanox python-ryu mlx4-config python/ python-2.7.5 python-django python-gunicorn python-setuptools python-smartpm python-voluptuous security/ shim-signed shim-unsigned tboot strorage-drivers/ python-3parclient python-lefthandclient virt/ cloud-init libvirt libvirt-python qemu tools/ storage-topology vm-topology utilities/ tis-extensions namespace-utils nova-utils update-motd Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86 Story: 2002801 Task: 22687 Signed-off-by: Scott Little <scott.little@windriver.com>
109 lines
2.7 KiB
Bash
Executable File
109 lines
2.7 KiB
Bash
Executable File
#! /bin/sh
|
|
#
|
|
# ntpd init.d script for ntpdc from ntp.isc.org
|
|
#chkconfig: 2345 20 20
|
|
|
|
# Source function library.
|
|
. /etc/init.d/functions
|
|
|
|
test -x /usr/sbin/ntpd -a -r /etc/ntp.conf || exit 0
|
|
# rcS contains TICKADJ
|
|
test -r /etc/default/rcS && . /etc/default/rcS
|
|
|
|
# Functions to do individual actions
|
|
settick(){
|
|
# If TICKADJ is set we *must* adjust it before we start, because the
|
|
# driftfile relies on the correct setting
|
|
test -n "$TICKADJ" -a -x /usr/sbin/tickadj && {
|
|
echo -n "Setting tick to $TICKADJ: "
|
|
/usr/sbin/tickadj "$TICKADJ"
|
|
echo "done"
|
|
}
|
|
}
|
|
startdaemon(){
|
|
# Perform initial ntp time correction
|
|
if [ -e /etc/ntp_initial.conf ]
|
|
then
|
|
echo -n "Performing initial ntp time correction: "
|
|
# ntpd -q hangs forever if it can't reach a server, so the timeout
|
|
# command is used to avoid this
|
|
/usr/bin/timeout 60s /usr/sbin/ntpd -q -g -c /etc/ntp_initial.conf
|
|
rc=$?
|
|
if [[ $rc == 0 ]]
|
|
then
|
|
echo "done"
|
|
# Time correction successful. Set hardware clock.
|
|
echo -n "Setting hardware clock: "
|
|
/sbin/hwclock -wu
|
|
if [[ $? == 0 ]]
|
|
then
|
|
echo "done"
|
|
else
|
|
echo "failed"
|
|
fi
|
|
else
|
|
echo "fail - hardware clock used to set system time"
|
|
fi
|
|
fi
|
|
|
|
# We do not use the -g option to start the ntpd. That allows the ntpd to
|
|
# make large time corrections. Although the man page says this will be
|
|
# done only once, testing indicates it can happen multiple times or
|
|
# happen long after the daemon starts, which can break services that
|
|
# are already running at that time.
|
|
echo -n "Starting ntpd: "
|
|
/sbin/start-stop-daemon --start -x /usr/sbin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@"
|
|
echo "done"
|
|
}
|
|
stopdaemon(){
|
|
echo -n "Stopping ntpd: "
|
|
/sbin/start-stop-daemon --stop -p /var/run/ntp.pid
|
|
echo "done"
|
|
|
|
# Set the hardware clock on shutdown so the clock will be as accurate as possible
|
|
# when the system comes back up.
|
|
echo -n "Setting hardware clock: "
|
|
/sbin/hwclock -wu
|
|
if [[ $? == 0 ]]
|
|
then
|
|
echo "done"
|
|
else
|
|
echo "failed"
|
|
fi
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
settick
|
|
startdaemon
|
|
;;
|
|
stop)
|
|
stopdaemon
|
|
;;
|
|
status)
|
|
status /usr/sbin/ntpd;
|
|
exit $?
|
|
;;
|
|
force-reload)
|
|
stopdaemon
|
|
settick
|
|
startdaemon
|
|
;;
|
|
restart)
|
|
# Don't reset the tick here
|
|
stopdaemon
|
|
startdaemon
|
|
;;
|
|
reload)
|
|
# Must do this by hand, but don't do -g
|
|
stopdaemon
|
|
startdaemon
|
|
;;
|
|
*)
|
|
echo "Usage: ntpd { start | stop | status | restart | reload }" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|