Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Timekeeping in Linux question ... Post 302513920 by Perderabo on Thursday 14th of April 2011 10:29:43 AM
Old 04-14-2011
I guess this is why it would be good to specify what version of Linux is involved. I am using RedHat. We install from a local server with some customizations, but I believe that the code I am about to show is standard RedHat....

On the way up the system clock is synced in /etc/rc.d/rc.sysinit via:
Code:
[ -x /sbin/hwclock ] && /sbin/hwclock $CLOCKFLAGS

On the way down there seems to be two opportunities to sync in the other direction:
Code:
# cd /etc/init.d
# grep hwclock *
halt:[ -x /sbin/hwclock ] && action $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS
ntpd:sync_hwclock() {
ntpd:   action $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS
ntpd:           [ "$SYNC_HWCLOCK" = "yes" ] && sync_hwclock
#

I would be very surprised in some distro moved this into the kernel. But then again I am frequently very surprised. Smilie

And while we are discussing Linux NTP configurations, our standard /etc/ntp.conf came with this abomination:
Code:
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

I wonder how widespread that is. That is a very bad idea. Undisciplined means that NTP keeps its hands off the system clock. It was intended for use on a system where the system clock is being disciplined by other software which has comminication with a very accurate clock. Also, as a kludge, it is suggested that with a cluster of computers with no way to contact a real NTP server, you could pick a system with a relatively accurate local clock, make it an NTP server, set the time and best you can, and use the above code to syncronize all the systems to your selected clock.

We were recently devestated by this collection of misfeatures. Our NTP server had all of these configuration settings. It locked up. I could not ssh in or access via the system console. It was no longer providing NTP service. So I rebooted it. It came right back up with no problems. It synced the system clock to the bios clock. But are now in EDT and bios clock still had EST, so the system time was off by one hour. NTP started and the NTP server contacted our master NTP server which is an appliance that gets its time fro the GPS satellites. When NTP first contacts an NTP server it does not instantly believe it. It takes several contacts over the space of several minutes to insure the NTP server is self-consistent before it will be accepted as a truechimer. Meanwhile the local clock is immediately accepted and selected as the primary peer. Now our NTP server sent out the wrong time to our entire campus. Other sites continued to have the correct time. Things went downhill pretty fast. Smilie

Last edited by Perderabo; 04-14-2011 at 12:25 PM.. Reason: fix code tag :P
This User Gave Thanks to Perderabo For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

linux newbie question...

I'm running Vector Linux on this computer, and everythign works fine, except for the NIC. I run netconfig, and then when I reboot it says: DC21140 at 0x9400(PCI BUS 0, device 11) h/w address 00:00:C0:2E:13:dC, and reqquires IRQ 9(provided by PCI BIOS) Setting up net subsytems. ... (5 Replies)
Discussion started by: Corey
5 Replies

2. UNIX for Dummies Questions & Answers

Timekeeping problem

Hello everyone I am currently exploring the different time keeping commands in linux. and I having a lot of trouble figuring out the advantages and disadvantages of using daytime command rdate and hwclock and such commands. Can someone link me to good articles or just give me the answer (5 Replies)
Discussion started by: maniac173
5 Replies

3. UNIX for Dummies Questions & Answers

Linux LVM Question

I've three partitions on /dev/sda: sda1, sda2 sda3. There is FREE space between sda2 and sda3 and sda3 ends on the last sector. sda2 and sda3 have the same number of sectors allocated and so are the exact same size. /dev/sda2 is already part of the VG VolGroup. However, what puzzles me is that... (0 Replies)
Discussion started by: Devyn
0 Replies

4. Linux

(ASK) Question about linux network...

hi all, im linux nubie n want to ask, 1. how to access the windows pc? if from windows to windows, we can use : start-run-\\192.168.1.1\e$ now, how about from linux (fedora) n want to access to windows drive? if I use ssh from linux to windows, ssh 192.168.6.171 ssh: connect... (6 Replies)
Discussion started by: busoh.sensen
6 Replies

5. UNIX for Dummies Questions & Answers

linux installation question?

Hi I accidentally installed another operating system after I had installed Linux and now I can no longer access your Linux system.any solution? Thanks (1 Reply)
Discussion started by: adam25bc
1 Replies

6. Shell Programming and Scripting

New to Linux, have some simple question

Hi All, Here is the problem: I have done a c++ code in Visual Studio 2010, it's a simple project that only have one main function which takes 2 parameters: an integer and a file that stores data. Now, I am asked to write a shell script in linux to execute my main function. I asked my professor... (1 Reply)
Discussion started by: EasonRU
1 Replies

7. UNIX for Advanced & Expert Users

Linux fdisk question (Oracle Enterprise Linux)

OS: Oracle Enterprise Linux 6.2 Hypervisor: VMWare workstation 9 I created a VM and attached a 7gb virtual disk to it. Using fdisk , I partioned the disk like below. The filesystems mounted on this is working fine. But I am seeing the message Partition n does not end on cylinder boundary.... (2 Replies)
Discussion started by: kraljic
2 Replies

8. Linux

Question on Linux Binary

Hi All, On linux system copied a /bin/kill to /bin/killlatest, when i tried to kill a command using /bin/killlatest it is failing with below errors /bin/killlatest 12345 ERROR: no "killlatest" support. Please help on this.. My ideas is to write a wrapper over killl command to find out who... (5 Replies)
Discussion started by: sridhar8183
5 Replies

9. UNIX for Dummies Questions & Answers

New to Linux scripting question

hello i am new to scripting and Linux in general. i am going to school for sys admin and i will need at least some knowledge on scripting. i have been so far ok with learning basic scripting now i am stuck. with a assignment that i was given it was create a script that will tell you if a number... (2 Replies)
Discussion started by: dragonwrench
2 Replies

10. UNIX for Dummies Questions & Answers

Linux question on directories..

Hi, First server every thing is working but keeps crashing so to be on the safe side created second server and moved all the files. But I notice there is a " dot " at the end. See below. Not sure what that means. Also getting 403 on Apache. Please see below. Thanks you so much. ls -l... (4 Replies)
Discussion started by: samnyc
4 Replies
All times are GMT -4. The time now is 01:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy