Veto Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 04 Jul 2003 Posts: 83
|
Posted: Sun Jul 06, 2003 10:31 pm Post subject: Patch to /etc/init.d/ntpd to set tickadj if required |
|
|
Some machines do not hold time well with the default tickadj. If you have adjusted your tickadj to make ntpd work reasonably well (~100ppm) then you might find this useful to automatically save and restore your tickadj values at boot or service start/stop/restart.
It looks for a /etc/ntp/tickadj.conf and if it exists it sets tick to the value held there. On stop it stores the current tick value to this value.
Code: |
--- ntpd 2003-07-01 12:19:46.000000000 -0500
+++ /shared/ntpd-tickadj 2003-07-06 17:26:12.000000000 -0500
@@ -20,6 +20,10 @@
start() {
checkconfig || return $?
+ if [ -f /etc/ntp/tickadj.conf ] ; then
+ /usr/bin/tickadj `cat /etc/ntp/tickadj.conf`
+ fi
+
if [ -n "${NTPDATE_CMD}" ] ; then
ebegin "Initializing clock via ${NTPDATE_CMD}"
${NTPDATE_CMD} ${NTPDATE_OPTS} > /dev/null
@@ -35,6 +39,7 @@
}
stop() {
+ /usr/bin/tickadj | sed -e "s/tick\ =\ //g" >/etc/ntp/tickadj.conf
ebegin "Stopping ntpd"
start-stop-daemon --stop --quiet --pidfile /var/run/ntpd.pid
eend $? "Failed to stop ntpd"
|
|
|