Merge "remove un-used files in ntp"

This commit is contained in:
Zuul 2018-10-23 05:50:33 +00:00 committed by Gerrit Code Review
commit 0b0e18a720
4 changed files with 0 additions and 244 deletions

View File

@ -1,14 +0,0 @@
# This is the most basic ntp configuration file
# The driftfile must remain in a place specific to this
# machine - it records the machine specific clock error
#driftfile /etc/ntp.drift
# This obtains a random server which will be close
# (in IP terms) to the machine. Add other servers
# as required, or change this.
#server time.server.example.com
# Using local hardware clock as fallback
# Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself
#server 127.127.1.0
#fudge 127.127.1.0 stratum 14
# Defining a default security setting - lock everything down
restrict default ignore

View File

@ -1,108 +0,0 @@
#! /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

View File

@ -1,14 +0,0 @@
# This is the most basic ntp configuration file
# The driftfile must remain in a place specific to this
# machine - it records the machine specific clock error
#driftfile /etc/ntp.drift
# This obtains a random server which will be close
# (in IP terms) to the machine. Add other servers
# as required, or change this.
#server time.server.example.com
# Using local hardware clock as fallback
# Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself
#server 127.127.1.0
#fudge 127.127.1.0 stratum 14
# Defining a default security setting
restrict default

View File

@ -1,108 +0,0 @@
#! /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