timezone temporarily wrong when running locales postinst

Bug #262825 reported by Mark Painter
8
Affects Status Importance Assigned to Milestone
tzdata (Debian)
Fix Released
Unknown
tzdata (Ubuntu)
Fix Released
Undecided
Martin Pitt
Declined for Dapper by Martin Pitt

Bug Description

When installing an updated locales package, the timezone on a machine may be incorrect for a short period of time.

Revision history for this message
Mark Painter (mpainter) wrote :
Revision history for this message
Mark Painter (mpainter) wrote :

This bug causes things like lines of logging to have incorrect timestamps for a short period of time during the locales postinst. This may lead to problems with log scraping and alerting.

In the development branch, the locales postinst does not touch the timezone so this is not an issue.

TEST CASE: run the locales postinst when the value in /etc/timezone matches the /etc/localtime symlink -- there should be no unlink of /etc/localtime

No regression is expected with this patch, there is no reason to depend upon timezone being flaky.

Revision history for this message
Martin Pitt (pitti) wrote :

Thank you for your report!

This isn't a bug that matches the stable release updates criteria, so we won't fiddle with that in dapper.

However, a similar problem still exists in Jaunty. Between the rm /etc/localtime and cp /usr/share/zoneinfo.../ /etc/localtime there is still a tiny race condition. This could be fixed by copying to localtime.new and atomically mv localtime.new localtime. Not sure whether it's worth the effort, though.

Changed in langpack-locales:
status: New → Triaged
Revision history for this message
Mark Painter (mpainter) wrote :

I agree that this isn't as much of an issue when localtime is going to actually change, but when it doesn't, it is annoying for the case of verbose log files where you end up with some number of entries with incorrect timestamps.

It's also an edge case where it's a problem, and worked around by logging with UTC timestamps, but I see little reason to not fix the bug, at least in new releases/versions.

Martin Pitt (pitti)
Changed in tzdata:
assignee: nobody → pitti
Revision history for this message
Martin Pitt (pitti) wrote :

Sent bug report and patch to Debian, so that we don't unnecessarily need to diverge.

Changed in tzdata:
assignee: pitti → nobody
Changed in tzdata:
status: Unknown → New
Revision history for this message
Martin Pitt (pitti) wrote :

Applied in Debian, will sync as soon as Karmic opens.

Changed in tzdata (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tzdata - 2009g-1ubuntu1

---------------
tzdata (2009g-1ubuntu1) karmic; urgency=low

  * Merge with Debian unstable. Remaining Ubuntu changes:
    - Install missing pacificnew timezone. (Debian #524046)
  * Debian applied the race condition fix for /etc/localtime.
    (LP: #262825)

tzdata (2009g-1) unstable; urgency=low

  [ Aurelien Jarno ]
  * postinst: fix race condition when updating /etc/localtime. Closes:
    bug#516755.

  [ Clint Adams ]
  * New upstream version.

 -- Martin Pitt <email address hidden> Tue, 28 Apr 2009 12:40:23 +0200

Changed in tzdata (Ubuntu):
status: Fix Committed → Fix Released
Changed in tzdata (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.