March 25, 2017, 04:43:29 am
Pages: [1]
Author Topic: FYI - Time sync (again)  (Read 1045 times)
Sr. Member
Posts: 378

View Profile
« on: April 03, 2012, 05:19:52 am »

As an FYI, I have solved the last (?) lingering problem with my method of time-sync for the OSD - namely, the problem of Daylight Saving Time.  The OSD has a weird notion of time - that is, it thinks it is on UTC, but is, in reality, on local time.  It is local time masquerading as UTC.  This means that it can never (in the shipped configuration) handle the switches to and from DST (BST for our UK readers).  That is, it cannot handle it w/o manual intervention.

However, I have found that by copying over a valid timezone file (in my case, the America/New_York file) from another Linux system, I can handle this, since the timezone file is DST-aware.  Thus, the command line(s) that I use to do the time-sync is:

# I copied the New_York file to the /mnt/OSD directory...
set -- $(TZ=/mnt/OSD/New_York rdate -p some.reliable.timeserver)
date -D "%b %d %H:%M:%S %Y" -s "$2 $3 $4 $5"

But I have a couple of questions:

1) Wouldn't it be nice if I could make this permanent?  I.e., actually run the system on New York time?  Has anyone done this?  (see comment #2 at end)

2) I've heard that other people have managed to get ntp working on the OSD...  How do they handle the timezone and DST issues?

Finally, a couple of "Gee, now that I think about it, I could have done..." comments:

1) The above method (using two commands to do it) was necessary in the past because of the limitations of the busybox "rdate" command, but may not be necessary any more.  It may be possible to do it in one line - i.e., using rdate directly to set the time.  I'll have to check this.

2) I think the method for setting the timezone is to make a file (or link) at /etc/timezone that is the timezone file.  Oh, but the problem with this is that /etc is read-only.  One could use the "mount --bind" hack to get around this, but the problem with that is that it may be too late - i.e., if you do it in rc.user, most of the system daemons (in particular, the scheduler) will have already started and they may not be smart enough to notice that the system's idea of time has changed.  I think that's why I never investigated this seriously.
Posts: 5

View Profile
« Reply #1 on: October 22, 2016, 07:44:34 am »

I recently found your post and have now been reading along. I thought I could leave my first comment. I don't understand what to express except that I have enjoyed reading. Nice post. I will keep visiting this post very often.
Tete a tete sofa
Pages: [1]
Jump to: