Time server...how to set it up on FC1?
Tom 'Needs A Hat' Mitchell
mitch48 at sbcglobal.net
Tue Apr 13 05:39:18 UTC 2004
On Mon, Apr 12, 2004 at 10:39:16PM -0600, Rodolfo J. Paiz wrote:
>
> At 22:32 4/12/2004, you wrote:
> >The new ntpdate will no longer make the brutal abrupt time adjustment
> >that some of us got to know and 'love'. I am not sure which behavior
> >is in the FC1/2 ntp package at this time but the "time"s they be a changing
> >on this point.
> >
> >Read all about it on the ntp home pages and in the Fedora archives.
>
> Most interesting. The last thing I read on the subject was a huge diatribe
> on the evils of ntpdate.
......
> Haven't had much time to STFW here, but can you point me to a URL or two?
http://www.eecis.udel.edu/~mills/ntp/html/ntpdate.html
...."The functionality of this program is now available in the ntpd
program. See the -q command line option in the ntpd - Network Time
Protocol (NTP) daemon page. After a suitable period of mourning, the
ntpdate program is to be retired from this distribution"....
-q Exit the ntpd just after the first time the clock is set. This
behavior mimics that of the ntpdate program, which is to be
retired. The -g and -x options can be used with this option.
-g Normally, ntpd exits if the offset exceeds the sanity limit,
which is 1000 s by default. If the sanity limit is set to zero,
no sanity checking is performed and any offset is acceptable.
This option overrides the limit and allows the time to be set
to any value without restriction; however, this can happen only
once. After that, ntpd will exit if the limit is exceeded.
This option can be used with the -q option.
-x Normally, the time is slewed if the offset is less than the
step threshold, which is 128 ms by default, and stepped if
above the threshold. This option forces the time to be slewed
in all cases. If the step threshold is set to zero, all offsets
are stepped, regardless of value and regardless of the -x
option. In general, this is not a good idea, as it bypasses the
clock state machine which is designed to cope with large time
and frequency errors Note: Since the slew rate is limited to
0.5 ms/s, each second of adjustment requires an amortization
interval of 2000 s. Thus, an adjustment of many seconds can
take hours or days to amortize. This option can be used with
the -q option.
But not all sources of time are ntp...
So here is one idea to get folks jumping up and down.....
In a pinch one can force the time in a brutal way.
Find a host that returns the correct time of day.
$ telnet 192.168.0.51 13
Trying 192.168.0.51...
Connected to (192.168.0.51).
Escape character is '^]'.
12 APR 2004 22:03:13 PDT
Connection closed by foreign host.
this can be cleaned up a bit
frog=`telnet 192.168.0.51 13| grep ^[0-9]`
echo $frog
The system date date can be set with 'date'. A little script magic to
do some sanity checking, translate month to a number etc. and get the
instant 'good time' that some people like.
# date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
It might better to do something like this first and
find out if there is value in all this.
frog=`telnet 192.168.0.51 13| grep ^[0-9]`
logger "Time at 192.168.0.51 is $frog"
Now an inspection of var/log/messages will tell you if you really want to
play with this stuff.
Apr 12 22:18:29 box1 bob: Time at 192.168.0.51 is 12 APR 2004 22:18:29 PDT
Apr 12 22:18:31 box1 bob: Time at 192.168.0.51 is 12 APR 2004 22:18:31 PDT
Apr 12 22:18:32 box1 bob: Time at 192.168.0.51 is 12 APR 2004 22:18:32 PDT
Other 'services' can be abused... which is why most are turned off.
$ grep time /etc/services
daytime 13/tcp
;-)
--
T o m M i t c h e l l
/dev/null the ultimate in secure storage.
More information about the fedora-list
mailing list