Gentoo Archives: gentoo-user

From: Bill Kenworthy <billk@×××××××××.au>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Getting a valid /etc/adjtime while using ntpd ?
Date: Thu, 17 Mar 2016 22:01:35
Message-Id: 56EB292D.7030300@iinet.net.au
In Reply to: Re: [gentoo-user] Getting a valid /etc/adjtime while using ntpd ? by Bill Kenworthy
1 On 18/03/16 05:59, Bill Kenworthy wrote:
2 > On 18/03/16 05:14, Alan McKinnon wrote:
3 >> On 17/03/2016 22:02, Håkon Alstadheim wrote:
4 >>> On 03/17/2016 02:03 PM, Bill Kenworthy wrote:
5 >>>> On 17/03/16 20:26, Alan McKinnon wrote:
6 >>>>> On 17/03/2016 08:50, Håkon Alstadheim wrote:
7 >>>>>> I have a server SUPPOSED to be running 24/7, but every once in a while
8 >>>>>> during a prolonged absence the box will go down. The Real Time Clock
9 >>>>>> will drift, and in the rush to get the box up again I let everything
10 >>>>>> boot up automatically and get both wrong time on the main systems, and
11 >>>>>> different times on the various systems.
12 >>>>>>
13 >>>>>> My setup has a main server which does NTP, but with no direct link to
14 >>>>>> the outside. Router&firewall /have/ to be booted booted later (dumb
15 >>>>>> setup, don't ask), after which I can finally get correct time from NTP.
16 >>>>>>
17 >>>>>> NTP initiates "11 minute mode", which makes /etc/adjtime useless as far
18 >>>>>> as I understand. Anybody have a /correct/ way to account for RTC drift
19 >>>>>> on a box running ntpd? Right now I have a ---file in
20 >>>>>> /etc/cron.d/time-bad like so:
21 >>>>>> * * * * * root adjtimex -S 5 >/dev/null 2>&1 </dev/null
22 >>>>>> ---
23 >>>>>>
24 >>>>>> Combined with an old-fashioned setup for hwclock during boot and
25 >>>>>> shutdown. This feels really wrong, and I have no idea what I am doing.
26 >>>>>>
27 >>>>>> TLDR: Anybody have a /correct/ way to account for RTC drift on a box
28 >>>>>> running ntpd?
29 >>>>>>
30 >>>>>>
31 >>>>>
32 >
33 > Have you looked at adjtimex ... its in portage
34 >
35 >
36 > From the man page ...
37 > "For a standalone or intermittently connected machine, where it’s not
38 > ossible to run ntpd, you may use adjtimex instead to correct the sys-tem
39 > clock for systematic drift.
40 >
41 > There are several ways to estimate the drift rate. If your
42 > computer can be connected to the net, you might run ntpd for at least
43 > several hours and run "adjtimex --print" to learn what values of tick
44 > and freq it settled on. Alternately, you could estimate values using as
45 > a reference the CMOS clock (see the --compare and --adjust switches),
46 > another host (see --host and --review), or some other source of time
47 > (see --watch and --review). You could then add a line to rc.local
48 > invoking adjtimex, or configure /etc/init.d/adjtimex or
49 > /etc/default/adjtimex, to set those parameters each time you reboot."
50 >
51 > Used it at one time for dialup which approximates your condition.
52 >
53 > BillK
54 >
55 >
56 forget it ... I forgot that's where you started from ... must be getting
57 old :(

Replies

Subject Author
Re: [gentoo-user] Getting a valid /etc/adjtime while using ntpd ? Mick <michaelkintzios@×××××.com>