Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 24080 - Add /etc/init.d/ntpd function to save/restore tick values automatically
Summary: Add /etc/init.d/ntpd function to save/restore tick values automatically
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Low enhancement
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-07 15:36 UTC by Rob Snow
Modified: 2003-08-11 10:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to /etc/init.d/ntpd (ntpd-patch.diff,614 bytes, patch)
2003-07-07 15:37 UTC, Rob Snow
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Snow 2003-07-07 15:36:32 UTC
The included patch makes /etc/init.d/ntpd check for a /etc/ntp/tickadj.conf file and if 
found sets tick to this value.  Also saves the current tick value on stop.  This is very 
handy for those people who have to adjust their tick values via tickadj when their 
system is inaccurate due to overclocking or bunk hw clock. 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.



--- 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"
Comment 1 Rob Snow 2003-07-07 15:37:04 UTC
Created attachment 14253 [details, diff]
patch to /etc/init.d/ntpd
Comment 2 Rob Snow 2003-07-08 00:40:30 UTC
I seem to have set it as a P2 when it's not, my apologies. 
Comment 3 SpanKY gentoo-dev 2003-08-05 22:49:52 UTC
doesnt the drift file take care of this ?
Comment 4 SpanKY gentoo-dev 2003-08-11 10:59:17 UTC
welp, as far as i know, the drift file serves this purpose