This is a discussion on S11.0 does not update change of time?? within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Manimoto wrote: > Ok thanks. Just what does /etc/localtime or /etc/localtime-copied-from localtime is a data file used to tell ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Manimoto wrote: > Ok thanks. Just what does /etc/localtime or /etc/localtime-copied-from localtime is a data file used to tell time-displaying applications how to transform UTC time into local time. localtime-copied-from is simply a symlink to the file from which localtime was copied, so that it's easier to replace when some misguided soul mangles the original. (I honestly don't know if it has any other purpose ...) > How does the time change occur automatically? No time "change" occurs. Your system time, in UTC keeps advancing forward. Your _displayed_ time is changed by whatever application is displaying it, based on transformations applied from the information in localtime. > What program was responsible for changing the time on my PC 3 days ago > when it went from Oct 29, 02:00 daylight saving time to Oct 29, 01:00? The time on your PC didn't change: it stayed at "Sun Oct 29 06:00:00 UTC 2006". Whatever program you use to display the time (such as "date") simply changed what it displays. > As to user-space, there are progs like tzfile, tzname, tzselect, > tzset, etc. I don't see any of these being used in any slackware > scripts - only hwclock is used. I don't understand why you're looking for programs used in Slackware's own scripts. Based on the names of these, I imagine they're related to adjusting the timezone, not the date/time. See the "date" command, and any of the "*clock" commands if you're running X. > Also there just are no "time related" daemons running which could be > responsible for auto time changing. That's right. The time didn't change. Your system time is kept in UTC, which has no concept of daylight savings (actually it's kept in seconds since Jan 1 00:00:00 UTC 1969, but that's beyond the scope of this discussion, in my opinion). The software you use to display the time simply changed its transformation to local time, based on daylight savings. Time only moves forward. > You seem to be a sys admin - right? Yes. > Hope you can answer these mind bending questions :-) I hope the above helps ... -- ---------------------------------------------------------------------- Sylvain Robitaille syl@alcor.concordia.ca Systems and Network analyst Concordia University Instructional & Information Technology Montreal, Quebec, Canada ---------------------------------------------------------------------- |
| |||
| On Tue, 31 Oct 2006 20:58:33 +0000 (UTC), Sylvain Robitaille <syl@alcor.concordia.ca> wrote: >Time only moves forward. Tell that to MSFT dual boot systems booting linux after DST change one may get +/- an hour. I run ntpdate on startup followed by ntpd to keep the time on track: rc.local: # kick ntpd time client /usr/sbin/ntpdate deltree /usr/sbin/ntpd After DST change I'll get a ~3600 second time shift. Of course this doesn't happen on the slack only boxen with RTC set to UTC. Only the firewall box's ntpd goes out to the public time servers, usually synced to a stratum 2 so localnet is stratum 3 accuracy. I've posted the client server setups here a while back, here they are again: Client /etc/ntp.conf # /etc/ntp.conf for slackware on sempro -- 2006-04-02 # # see: http://ntp.isc.org/bin/view/Support/ConfRestrict # restrict default server 192.168.1.1 iburst restrict 192.168.1.1 restrict 127.0.0.1 # driftfile /etc/ntp/drift # Localnet server (facing Internet) /etc/ntp.conf: # /etc/ntp.conf for slackware on deltree 2004-11-18 # 2005-03-02 Added tpg.com.au timeserver # # Configuration, see # http://twiki.ntp.org/bin/view/Servers/NTPPoolServers # http://ntp.isc.org/bin/view/Support/ConfRestrict # configure local clock as dummy refclock, making sure any clients # know that it is not a high quality clock with stratum = 10 # Note that setting a dummy refclock seems a bad idea (2005-01-08) #server 127.127.1.0 #fudge 127.127.1.0 stratum 10 # drift and log files driftfile /etc/ntp/drift logfile /var/log/ntp_log # Monitoring performance # from: http://www.ntp.org/ntpfaq/NTP-s-trouble.htm #statistics loopstats #statsdir /var/log/ #filegen peerstats file peers type day link enable #filegen loopstats file loops type day link enable # Access control and server selection: # set default restrictions restrict default kod nomodify notrap nopeer noquery # select time servers server ntp1.tpg.com.au server au.pool.ntp.org server us.pool.ntp.org server ca.pool.ntp.org server uk.pool.ntp.org # restrict local server users less restrict 127.0.0.1 restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap nopeer restrict 192.168.2.0 mask 255.255.255.0 nomodify notrap nopeer # end Server state: root@deltree:~# ntpq -np remote refid st t when poll reach delay offset jitter ================================================== ============================ +203.12.160.2 203.35.83.242 2 u 331 1024 377 67.344 -5.540 0.852 -220.233.200.157 66.187.233.4 2 u 10 1024 377 113.464 11.064 3.485 *204.152.189.171 216.218.254.202 2 u 10 1024 377 231.490 -2.474 2.045 -216.252.70.172 199.212.17.22 3 u 62 1024 277 363.161 8.159 15.223 +212.20.244.147 132.146.236.132 3 u 68 1024 377 412.746 -4.591 2.013 Client state: root@peetoo:~# ntpq -np remote refid st t when poll reach delay offset jitter ================================================== ============================ *192.168.1.1 204.152.189.171 3 u 623 1024 377 11.667 0.825 0.284 Grant. -- http://bugsplatter.mine.nu/ |
| |||
| Sylvain: > No time "change" occurs. Your system time, in UTC keeps advancing > forward. Your _displayed_ time is changed by whatever application is > displaying it, based on transformations applied from the information in > localtime. > > > What program was responsible for changing the time on my PC 3 days ago > > when it went from Oct 29, 02:00 daylight saving time to Oct 29, 01:00? > > The time on your PC didn't change: it stayed at "Sun Oct 29 06:00:00 UTC > 2006". Whatever program you use to display the time (such as "date") > simply changed what it displays. Thanks for the answers but they perplex me more than anything now. Let me give you an example. A friend has a pc that is dual boot (Win98 and Linux). It was switched off over Saturday Oct 28 - Sunday Oct 29. On Oct 30 10:00 am, she booted it up into Linux and realized that the time had *NOT* been adjusted from Daylight Savings to normal. The time should have been displayed as 09:00. So she rebooted into windows which adjusted the time, and displayed it correctly (1 hour back). Later she rebooted into Linux and now it too displayed the *correct* time. She used the "date" program to display the date/time before and after the Win98 adjustment. So what happened? The same Linux program was used to display the timestamp before and after an adjustment to the hardware clock was made. However before MSWIN made the adjustment to the hw clock, "date" displayed an incorrect one. After the adjustment by MSWin, "date" showed the correct timestamp. If indeed on a PC time marches forward only, and is stored in UTC seconds, then after MSWin's adjustment, Linux should have displayed the incorrect time (assuming that it displayed the correct adjusted time to begin with - which it did not). And yes the Linux /etc/localtime was correclty set to Canada, Eastern timezone :-) According to your explanation, the Linux date program should have displayed the correct timestamp before the Win98 adjustment. Also why would MSWIn need to reset the hwclock 1 hour back, when a UN*X system does not, (if I understand you correctly). They both refer to the pc's hw clock - which is in UTC seconds (?) I'm not trying to keep this topic going on and on, but *NOW* I am really curious as to just how time is stored, modified, and displayed on Slackware (in particular) UNIX in general. Thx |
| |||
| Grant wrote: >> Time only moves forward. > > Tell that to MSFT dual boot systems Do you use the "sample" credit cards that came with your wallet? Why do you use the sample OS that came with your computer? ;-) -- ---------------------------------------------------------------------- Sylvain Robitaille syl@alcor.concordia.ca Systems and Network analyst Concordia University Instructional & Information Technology Montreal, Quebec, Canada ---------------------------------------------------------------------- |
| |||
| Manimoto wrote: > A friend has a pc that is dual boot (Win98 and Linux). ... Windows is unfortunately not on my radar. My understanding is that it stores time of day information in the CMOS clock upon shutting down, but I don't really know for sure whether it does or why. > ... MSWIN made the adjustment to the hw clock, ... Therein lies the complication. Windows adjusted the hardware clock. I don't have that problem, though I admit to not being able to explain it either. > According to your explanation, the Linux date program should have > displayed the correct timestamp before the Win98 adjustment. Win98 not on my radar. I can't explain its behaviour. > Also why would MSWIn need to reset the hwclock 1 hour back, when a > UN*X system does not, (if I understand you correctly). They both refer > to the pc's hw clock - which is in UTC seconds (?) You'll have to ask someone with better knowledge of windows about its behaviour. Generally Unix/Linux does not refer to the CMOS clock, except to get the time at startup, which it then converts to seconds since the epoch, and maintains system time that way. > I'm not trying to keep this topic going on and on, but *NOW* I am > really curious as to just how time is stored, modified, and displayed > on Slackware (in particular) UNIX in general. Remember algebra where the thing was to simplify equations? Eliminate Windows from this equation ... -- ---------------------------------------------------------------------- Sylvain Robitaille syl@alcor.concordia.ca Systems and Network analyst Concordia University Instructional & Information Technology Montreal, Quebec, Canada ---------------------------------------------------------------------- |
| |||
| Manimoto wrote: > Sylvain: > >>No time "change" occurs. Your system time, in UTC keeps advancing >>forward. Your _displayed_ time is changed by whatever application is >>displaying it, based on transformations applied from the information in >>localtime. >> >> >>>What program was responsible for changing the time on my PC 3 days ago >>>when it went from Oct 29, 02:00 daylight saving time to Oct 29, 01:00? >> >>The time on your PC didn't change: it stayed at "Sun Oct 29 06:00:00 UTC >>2006". Whatever program you use to display the time (such as "date") >>simply changed what it displays. > > > Thanks for the answers but they perplex me more than anything now. > Let me give you an example. Let's make a distinction between two different clocks. There is the system (kernel) clock, counting the seceonds expired since jan 1 1970 0:00 UTC. It's just a counter incrementing one tick each second. That is the clock that is used (after conversion) to display the time if you type "date", or for the time displayed by "xclock". Normaly the displayed time will be your local wall clock time but you can choose any timezone representation that you like. Its just a conversion of the value of the seconds counter after all. And there is also a battery powerd "hardware clock". This clock is _only_ used at boot time to initialize the above mentioned system clock. /etc/rc.S calls "/sbin/hwclock" to read the hardware clock. At shutdown or reboot time "/sbin/hwclock" is used again (by /etc/rc.0 or /etc/rc.6) to synchronize the hardware clock with your system clock. You have two options to run your hardware clock. The option you chose is stored in /etc/hardwareclock. If you run that clock at UTC time nothing has to be changed with respect to daylight saving time. You can run that clock at your local wall clock time. In that case the boot scripts expects a your hardware clock running at the correct time, even if the time changed. So you have to adjust the clock (for instance in the BIOS setup) before booting or linux will show the wrong time. If the computer was running linux during the time change then your hardware clock will automatically be adjusted at the nest shutdown. You'r in trouble if you run your hardware clock at local time _and_ you boot between 02:00 and 03:00 in the night the time changes. There is no way for the software to decide if this is before or after the time change. Of course if you run at UTC there is no problem at all. From a linux point of view you should simply run hour hardware clock at UTC. Period. But, most windoze variants expect the hardware running at local wall clock time. So if you run windoze you have to adjust the hardware clock two times a year. Windoze is happy to do this automatically for you. Nice of windoze? Not realy. If windoze decides that the clock has to be adjusted when you boot the next time, it _will_ adjust the clock. Even if a month has past and the clock has been adjusted a month ago by linux! This is more or less the whole story. If it still looks complicated just synchronize your clock with an external time server like Grant said. Regards, Kees. -- Kees Theunissen. |
| |||
| On Wed, 01 Nov 2006 00:21:03 +0100, Kees Theunissen <theuniss@rijnh.nl> wrote: >But, most windoze variants expect the hardware running at local >wall clock time. So if you run windoze you have to adjust the >hardware clock two times a year. Windoze is happy to do this >automatically for you. Nice of windoze? Not realy. Just for grins I booted laptop in Win98, wall time was about 10:30, it set the time to 01:00! Why? Win98 saves a time checksum into CMOS memory, so it knew the time had been fiddled behind its back, took a punt and reset the clock to midnight then added an hour (I'm down under, we starting summer time). Win98 told me it changed the time and opened the date applet. Okay, so I reboot into Win2k --> it silently adds another hour to the time, so the 'doze situation is hilarious. At least now the rarely booted 'doze will stop playing with the clock for a few months. Boot slack and ntpdate steps time 30784.468186 sec to return to reality Grant. -- http://bugsplatter.mine.nu/ |
| |||
| Grant wrote: > Just for grins I booted laptop in Win98, wall time was about 10:30, it set > the time to 01:00! Why? Win98 saves a time checksum into CMOS memory, so > it knew the time had been fiddled behind its back, took a punt and reset > the clock to midnight then added an hour (I'm down under, we starting summer > time). Win98 told me it changed the time and opened the date applet. The ever changing time protected by a checksum? I don't think so. But the rest (the static part) of the CMOS memory _is_ protected by a checksum. This is to prevent strange BIOS settings if your battery is getting empty. Maybe it's time to start thinking about a new battery. > > Okay, so I reboot into Win2k --> it silently adds another hour to the time, > so the 'doze situation is hilarious. Yes, it is. In WinXP (prof) you can switch off this auto adjustment. I'm not sure about 2k and XP home. > > At least now the rarely booted 'doze will stop playing with the clock for a > few months. > > Boot slack and ntpdate steps time 30784.468186 sec to return to reality > > Grant. Kees. -- Kees Theunissen. |
| |||
| On 2006-10-31, Sylvain Robitaille <syl@alcor.concordia.ca> wrote: > Grant wrote: > >>> Time only moves forward. >> >> Tell that to MSFT dual boot systems > > Do you use the "sample" credit cards that came with your wallet? Why do > you use the sample OS that came with your computer? ;-) </modquote> That's good stuff, I tell you... :-) RW -- http://rlworkman.net |
| ||||
| On Tue, 31 Oct 2006 22:21:40 +0000, Sylvain Robitaille wrote: > Grant wrote: > >>> Time only moves forward. >> >> Tell that to MSFT dual boot systems > > Do you use the "sample" credit cards that came with your wallet? Why do > you use the sample OS that came with your computer? ;-) Because chololate milk doesn't have seeds. ;-) Cheers! Rich |