[opensuse] Re: chrony and hwclock
Per Jessen wrote:
Joachim Schrod wrote:
It is also clear that the switching of time servers according to availability and quality works very well, just as it is (fairly) clear that Roger's problem is more of a timezone issue than an ntp ditto.
I wasn't referring to Roger's laptop problem. That clearly seems like a configuration error. I referred to his goal to get robust and reliable time syncs in his automotive IT systems, i.e., in embedded car systems with intermittent GPS connections.
I had big problems in the past when ntpd decides that a time source is too unreliable and either drops it, or maybe even terminates itself because all time sources are too much off.
But localhost would surely always be available?
That's not the problem. If you start ntpd with only localhost, and if a time server gets available later whose time is different by more than 20 minutes, ntpd will terminate itself. (To be more precise: the difference must be as large for some polls, 8 IIRC, to get a full reach shift register of 0377. But polling is not good for Roger's automotive IT use case and should be avoided anyhow, we have already agreed upon that.) Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Joachim Schrod wrote:
I had big problems in the past when ntpd decides that a time source is too unreliable and either drops it, or maybe even terminates itself because all time sources are too much off.
But localhost would surely always be available?
That's not the problem. If you start ntpd with only localhost, and if a time server gets available later whose time is different by more than 20 minutes, ntpd will terminate itself. (To be more precise: the difference must be as large for some polls, 8 IIRC, to get a full reach shift register of 0377.
I agree, this is a potential problem. (the sanity check is 1000s ~ 16min). -- Per Jessen, Zürich (18.1°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 2011-07-18 at 19:36 +0200, Per Jessen wrote:
Joachim Schrod wrote:
I had big problems in the past when ntpd decides that a time source is too unreliable and either drops it, or maybe even terminates itself because all time sources are too much off.
But localhost would surely always be available?
That's not the problem. If you start ntpd with only localhost, and if a time server gets available later whose time is different by more than 20 minutes, ntpd will terminate itself. (To be more precise: the difference must be as large for some polls, 8 IIRC, to get a full reach shift register of 0377.
I agree, this is a potential problem. (the sanity check is 1000s ~ 16min).
Can I be sure ntp knows that my 2 hour time difference on the hardware clock is correct and not an error? Remember that the hardware clock is UTC time. And we do not all live in that timezone. I can't help but feel that when a non-localhost server is not found, ntp gets confused about this. -- Roger Oberholtzer OPQ Systems / Ramböll RST Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 SHAW'S PRINCIPAL Build a system that even a fool can use, and only a fool will want to use it. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Roger Oberholtzer said the following on 07/18/2011 06:29 PM:
Can I be sure ntp knows that my 2 hour time difference on the hardware clock is correct and not an error? Remember that the hardware clock is UTC time. And we do not all live in that timezone. I can't help but feel that when a non-localhost server is not found, ntp gets confused about this.
Many of us who don't like in the UTC timezone can say "it works for me". I set this all up CLI from the man pages and a How-To a long time ago, so I don't think I can led you though it, and as hers have pointed out, my idea of what goes where is a bit confused. But I don't have the problems you describe. What you seem to be saying is that if NTP can't find an external reference (e.g. the network isn't up, the laptop is 'standalone') you see a problem. You think the problem is that the hardware clock being UTC and being 2 hours different from localtime is the problem. Well my hardware clock s FIVE hours away from my local time. But I don't have your problems. In "man hwclock: I read <quote> -u, --utc --localtime Indicates that the Hardware Clock is kept in Coordinated Universal Time or local time, respectively. It is your choice whether to keep your clock in UTC or local time, but nothing in the clock tells which you've chosen. So this option is how you give that information to hwclock. If you specify the wrong one of these options (or specify neither and take a wrong default), both setting and querying of the Hardware Clock will be messed up. If you specify neither --utc nor --localtime , the default is whichever was specified the last time hwclock was used to set the clock (i.e. hwclock was successfully run with the --set, --systohc, or --adjust options), as recorded in the adjtime file. <quote> My understanding is that "under the hood" UNIX of old ALWAYS worked in GMT, which we now UTC. I believe all Internet clocks work in UTC as well.. At the application layer the translation from UTC/GMT to local time is done. That's where DST and the like are accommodated. It may be that you have the variable "TZ" in the environment. Or not. In which case, as the manual says, a system default is used. Which is probably the timezone information in compiled form in /etc/timezone See "apropos timezone" However the above quote makes it clear that you can mess things up. [1] http://www.nist.gov/pml/div688/grp40/its.cfm <quote> Many of the available NTP software clients for personal computers don’t do any averaging at all. Instead, they make a single timing request to a signal server (just like a Daytime or Time client) and then use this information to set their computer’s clock. The proper name for this type of client is SNTP (Simple Network Time Protocol). The NIST servers listen for a NTP request on port 123, and respond by sending a udp/ip data packet in the NTP format. The data packet includes a 64-bit timestamp containing the time in UTC seconds since January 1, 1900 with a resolution of 200 ps. </quote> I use three reference servers in North America -- Knowledge will forever govern ignorance: And a people who mean to be their own governours, must arm themselves with the power which knowledge gives. --James Madison, quoted on the Library of Congress -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 2011-07-18 at 19:57 -0400, Anton Aylward wrote:
Roger Oberholtzer said the following on 07/18/2011 06:29 PM:
Can I be sure ntp knows that my 2 hour time difference on the hardware clock is correct and not an error? Remember that the hardware clock is UTC time. And we do not all live in that timezone. I can't help but feel that when a non-localhost server is not found, ntp gets confused about this.
Many of us who don't like in the UTC timezone can say "it works for me".
I set this all up CLI from the man pages and a How-To a long time ago, so I don't think I can led you though it, and as hers have pointed out, my idea of what goes where is a bit confused.
But I don't have the problems you describe.
[Stuff about setting it up by hand deleted.] The system was set up by YaST during installation. In one of the first dialogs, I specified that the PC clock was set to UTC time (I had done this in the BIOS before installation) and I indicated that I was in Sweden. We do this all the time in all our remote systems and it has always worked, including things like daylight savings time changes being automatic. It is only when I introduced ntp that the mystery appeared. And ntp is also set up by YaST. I posted my settings elsewhere in the thread. Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Roger Oberholtzer wrote:
The system was set up by YaST during installation. In one of the first dialogs, I specified that the PC clock was set to UTC time (I had done this in the BIOS before installation)
In the BIOS settings? I don't think I ever had reason to do that. If your BIOS knowns about timezones, maybe there's an interaction here that we're not aware of.
and I indicated that I was in Sweden. We do this all the time in all our remote systems and it has always worked, including things like daylight savings time changes being automatic.
Yep, that's what I do too (except I pick Switzerland :-), but the timezone is the same). -- Per Jessen, Zürich (16.4°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 2011-07-19 at 08:20 +0200, Per Jessen wrote:
Roger Oberholtzer wrote:
The system was set up by YaST during installation. In one of the first dialogs, I specified that the PC clock was set to UTC time (I had done this in the BIOS before installation)
In the BIOS settings? I don't think I ever had reason to do that. If your BIOS knowns about timezones, maybe there's an interaction here that we're not aware of.
The clock seen in the BIOS is the one that survives power cycling. It is the battery powered clock that is the start of all this. The time that the SUSE install asks about being in UTC time, is this clock. So I have it set to UTC. It does not know about timezones. It is simply the UTC clock.
and I indicated that I was in Sweden. We do this all the time in all our remote systems and it has always worked, including things like daylight savings time changes being automatic.
Yep, that's what I do too (except I pick Switzerland :-), but the timezone is the same).
-- Per Jessen, Zürich (16.4°C)
Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Roger Oberholtzer said the following on 07/19/2011 03:08 AM:
The clock seen in the BIOS is the one that survives power cycling. It is the battery powered clock that is the start of all this. The time that the SUSE install asks about being in UTC time, is this clock. So I have it set to UTC. It does not know about timezones. It is simply the UTC clock.
Quite correct. It is, as I said, the application layers that know about timezones. It is how you set up /etc/timezone and the parameters you give to 'hwclock' -- as I said in my previous post - that determine the behaviour you are having problems with. -- Mary had a little key (It's all she could export), and all the email that she sent was opened at the Fort. -- Ron Rivest -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Roger Oberholtzer wrote:
On Mon, 2011-07-18 at 19:36 +0200, Per Jessen wrote:
Joachim Schrod wrote:
I had big problems in the past when ntpd decides that a time source is too unreliable and either drops it, or maybe even terminates itself because all time sources are too much off.
But localhost would surely always be available?
That's not the problem. If you start ntpd with only localhost, and if a time server gets available later whose time is different by more than 20 minutes, ntpd will terminate itself. (To be more precise: the difference must be as large for some polls, 8 IIRC, to get a full reach shift register of 0377.
I agree, this is a potential problem. (the sanity check is 1000s ~ 16min).
Can I be sure ntp knows that my 2 hour time difference on the hardware clock is correct and not an error? Remember that the hardware clock is UTC time. And we do not all live in that timezone.
ntp doesn't care about timezones. http://en.wikipedia.org/wiki/Network_Time_Protocol "It provides Coordinated Universal Time (UTC). No information about time zones or daylight saving time is transmitted; this information is outside its scope and must be obtained separately." -- Per Jessen, Zürich (16.1°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 2011-07-19 at 08:14 +0200, Per Jessen wrote:
ntp doesn't care about timezones.
http://en.wikipedia.org/wiki/Network_Time_Protocol
"It provides Coordinated Universal Time (UTC). No information about time zones or daylight saving time is transmitted; this information is outside its scope and must be obtained separately."
OK. That should not be a problem, I guess. The timezone thing is a per-user setting, not a system setting. The question asked during the openSUSE install about this is just to get a default value for this. That my clock in Linux is off by the same difference could always be an unfortunate coincidence. More time checking will happen this evening when I have access to the offending system. Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Roger Oberholtzer wrote:
On Tue, 2011-07-19 at 08:14 +0200, Per Jessen wrote:
ntp doesn't care about timezones.
http://en.wikipedia.org/wiki/Network_Time_Protocol
"It provides Coordinated Universal Time (UTC). No information about time zones or daylight saving time is transmitted; this information is outside its scope and must be obtained separately."
OK. That should not be a problem, I guess. The timezone thing is a per-user setting, not a system setting.
Hmm, I think it's a system thing too - see /etc/localtime -- Per Jessen, Zürich (17.3°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 2011-07-19 at 10:44 +0200, Per Jessen wrote:
Roger Oberholtzer wrote:
On Tue, 2011-07-19 at 08:14 +0200, Per Jessen wrote:
ntp doesn't care about timezones.
http://en.wikipedia.org/wiki/Network_Time_Protocol
"It provides Coordinated Universal Time (UTC). No information about time zones or daylight saving time is transmitted; this information is outside its scope and must be obtained separately."
OK. That should not be a problem, I guess. The timezone thing is a per-user setting, not a system setting.
Hmm, I think it's a system thing too - see /etc/localtime
There are two possible usage scenarios: 1. The hardware is in UTC time, and there is a timezone specified that specifies how to report the local time from the UTC time. 2. The hardware is in localtime, and there is a timezone specified that specifies how this differs from UTC time. If ntp is used in a scenario 2, wouldn't it need to be able to set the clock to local time and not UTC time? How would it do this if it did not deal with timezones? Or does the boot.clock always put the clock in UTC time no matter? So, in my case, the clock would be left alone - it is specified as already being in UTC time. In scenario 2, the system would change the hardware clock, based on the timezone, to UTC time. And set it back when the system is shutdown. Then ntp would indeed only fiddle with UTC time, which it assumes the hardware clock always to be using. So I am really confused why restarting ntp moves the time by 2 hours. Plenty of places where something can go amiss. Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Roger Oberholtzer said the following on 07/19/2011 03:12 AM:
On Tue, 2011-07-19 at 08:14 +0200, Per Jessen wrote:
ntp doesn't care about timezones.
http://en.wikipedia.org/wiki/Network_Time_Protocol
"It provides Coordinated Universal Time (UTC). No information about time zones or daylight saving time is transmitted; this information is outside its scope and must be obtained separately."
OK. That should not be a problem, I guess. The timezone thing is a per-user setting, not a system setting.
Perhaps. But I think it is a system setting. It is on my installations - openSUSE, Mandriva and Redhat It is in /etc/timezone. Yes, it can be overridden on a per user basis with the TZ environment variable. Check to see if you have that set.
The question asked during the openSUSE install about this is just to get a default value for this.
-- "Education must precede motivation." Jim Rohn -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Anton Aylward wrote:
Roger Oberholtzer said the following on 07/19/2011 03:12 AM:
OK. That should not be a problem, I guess. The timezone thing is a per-user setting, not a system setting.
Perhaps. But I think it is a system setting. It is on my installations - openSUSE, Mandriva and Redhat It is in /etc/timezone.
Yes, it can be overridden on a per user basis with the TZ environment variable. Check to see if you have that set.
TZ is not relevant as it is not set during boot, when /etc/init.d/{boot.clock,ntpd} are run. You are currect in your first assumption that hwclock during boot and shutdown only cares for /etc/localtime. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Joachim Schrod said the following on 07/19/2011 10:44 AM:
Yes, it can be overridden on a per user basis with the TZ environment variable. Check to see if you have that set.
TZ is not relevant as it is not set during boot, when /etc/init.d/{boot.clock,ntpd} are run.
100% true and 100% beside the point. As I said .... there is the system level setting, but once a user logs in he may not be in the same time zone as the machine and will need to be able to over-ride the timezone for his session. Since the time the user sees, the time that Roger sees, is when he logs in and runs commands, he should make sure that his session is not running in a different timezone from the machine, that TZ has not been set somewhere in the _shell_ initialization and then used by the commands that display the - interpreted - local time. Since he is running commands a reporting their output rather than using some "raw" core inspection language it is possible that TZ has been set. Maybe in /etc/profile.d/ or maybe in ~/.profile. Maybe. Unlikely, and I hope not, but the possibility needs to be eliminated so we don't turn round and say "DUH!" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen said the following on 07/19/2011 02:14 AM:
Can I be sure ntp knows that my 2 hour time difference on the hardware clock is correct and not an error? Remember that the hardware clock is UTC time. And we do not all live in that timezone.
ntp doesn't care about timezones.
http://en.wikipedia.org/wiki/Network_Time_Protocol
"It provides Coordinated Universal Time (UTC). No information about time zones or daylight saving time is transmitted; this information is outside its scope and must be obtained separately."
If you think about it for a moment that *HAS* to be the case. Any particular reference site can be accessed from anywhere in the world - that is from any time zone. The 'seperately' in teh case of Linux comes from _either_ consulting the TZ environment variable _or_ consulting /etc/timezone -- I clicked my heels together three times and wished I was in Cuba, but the reality fairy smacked me in the head and flew away laughing! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Tue, 2011-07-19 at 07:33 -0400, Anton Aylward wrote:
Per Jessen said the following on 07/19/2011 02:14 AM:
Can I be sure ntp knows that my 2 hour time difference on the hardware clock is correct and not an error? Remember that the hardware clock is UTC time. And we do not all live in that timezone.
ntp doesn't care about timezones.
http://en.wikipedia.org/wiki/Network_Time_Protocol
"It provides Coordinated Universal Time (UTC). No information about time zones or daylight saving time is transmitted; this information is outside its scope and must be obtained separately."
If you think about it for a moment that *HAS* to be the case. Any particular reference site can be accessed from anywhere in the world - that is from any time zone.
The 'seperately' in teh case of Linux comes from _either_ consulting the TZ environment variable _or_ consulting /etc/timezone
The ntp protocol would be most sane if it were transmitted only as UTC. What a local system decides to do with that information is a whole different question - and one the ntp protocol really can't address. openSUSE seems to expect that the system clock is UTC, no matter what the battery clock is. Or this is how it looks to me. Yours sincerely, Roger Oberholtzer OPQ Systems / Ramböll RST Office: Int +46 10-615 60 20 Mobile: Int +46 70-815 1696 roger.oberholtzer@ramboll.se ________________________________________ Ramböll Sverige AB Krukmakargatan 21 P.O. Box 17009 SE-104 62 Stockholm, Sweden www.rambollrst.se -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Roger Oberholtzer said the following on 07/19/2011 08:00 AM:
The ntp protocol would be most sane if it were transmitted only as UTC.
That is in fact the case as both Per and I have pointed out by reference.
What a local system decides to do with that information is a whole different question - and one the ntp protocol really can't address.
Sort of. NTP only has to set the itnernal - software I beelive - system clock. That runs on UTC.
openSUSE seems to expect that the system clock is UTC,
I think that is so. It has always been the case, to the best of my knowledge, with UNIX systems. It needs to be so since different users or different applciations may be working in different timezones, so each have their offset from UTC.
no matter what the battery clock is. Or this is how it looks to me.
I have referred to "man hwclock" and that seems to be the point at which the battery clock being UTC or local comes into it. Once again: <quote> -u, --utc --localtime Indicates that the Hardware Clock is kept in Coordinated Universal Time or local time, respectively. It is your choice whether to keep your clock in UTC or local time, but nothing in the clock tells which you've chosen. So this option is how you give that information to hwclock. If you specify the wrong one of these options (or specify neither and take a wrong default), both setting and querying of the Hardware Clock will be messed up. If you specify neither --utc nor --localtime , the default is whichever was specified the last time hwclock was used to set the clock (i.e. hwclock was successfully run with the --set, --systohc, or --adjust options), as recorded in the adjtime file. <quote> -- "Nothing is more difficult to carry out, nor more doubtful of success, nor more dangerous to handle, than to initiate a new order of things." -- Machiavelli -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Roger Oberholtzer wrote:
openSUSE seems to expect that the system clock is UTC, no matter what the battery clock is. Or this is how it looks to me.
Exactly so, and not just opensuse. The kernels of all Unix and Linux systems run in UTC. Bad things happen if they are made not to. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (5)
-
Anton Aylward
-
Dave Howorth
-
Joachim Schrod
-
Per Jessen
-
Roger Oberholtzer