Bug 66655 - dateconfig mangles timezone files when switching timezones
dateconfig mangles timezone files when switching timezones
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: dateconfig (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Brent Fox
:
: 79429 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-06-12 23:58 EDT by Need Real Name
Modified: 2007-04-18 12:43 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-06-13 12:24:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fix deletion of /usr/share/zoneinfo files (640 bytes, patch)
2004-12-15 22:11 EST, Matt Seitz
no flags Details | Diff

  None (edit)
Description Need Real Name 2002-06-12 23:58:08 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1a) Gecko/20020610

Description of problem:
When using dateconfig to set the timezone from America/Los_Angeles to
America/New_York, America/Los_Angles is overwritten by America/New_York. This
may occur in other instances.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. back up Los_Angles and New_York in /usr/share/zoneinfo/America/
2. run dateconfig and change timezone from Los_Angeles to New_York
3. diff Los_Angeles and the backup, they are different
4. diff Los_Angeles and New_York, they are the same.
5. run dateconfig and change timezone from New_York to Los_Angeles
6. file Los_Angeles, it is now zero length
7. run date, the system clock now reports UTC


Actual Results:  
[root@alexandria America]# date
Wed Jun 12 20:50:59 PDT 2002
[root@alexandria America]# dateconfig
Shutting down ntpd:                                        [FAILED]
[root@alexandria America]# diff Los_Angeles Los_Angeles.BAK
Binary files Los_Angeles and Los_Angeles.BAK differ
[root@alexandria America]# diff Los_Angeles New_York
[root@alexandria America]# dateconfig
Shutting down ntpd:                                        [FAILED]
[root@alexandria America]# file Los_Angeles
Los_Angeles: empty
[root@alexandria America]# date
Thu Jun 13 03:52:22 UTC 2002
[root@alexandria America]#

Expected Results:  timezone should be set correctly with no change to timezone files

Additional info:

It appears that whatever timezone the machine booted in is the one that gets
mangled, and that this is not just between America/Los_Angeles and
America/New_York, but I have not extensively tested further than this.
Comment 1 Brent Fox 2002-06-13 10:36:42 EDT
I cannot reproduce this behavior.  dateconfig never opens any files in
/usr/share/zoneinfo for writing.  As you can see from
/usr/share/dateconfig/timezoneBackend.py:

    def writeConfig (self, timezoneData):
        self.tz, self.utc, self.arc = timezoneData
        
        instPath = ""
        fromFile = "/usr/share/zoneinfo/" + self.tz

        try:
            self.copyFile(fromFile, instPath + "/etc/localtime")
        except OSError, (errno, msg):
            print (_("Error copying timezone (from %s): %s") % (fromFile, msg))


So we copy the correct timezone file from /usr/share/zoneinfo to /etc/localtime,
but no modification of any files in /usr/share/zoneinfo takes place.  I don't
know how to explain the behavior that you're seeing.
Comment 2 Need Real Name 2002-06-13 12:19:16 EDT
my /etc/localtime has become a link pointing back to
/usr/share/zoneinfo/America/Los_Angeles. dateconfig does not handle this
properly. The link was created by /usr/bin/kcmshell 'clock' when I used it to
change the timezone earlier.
Comment 3 Brent Fox 2002-06-13 12:24:45 EDT
Oh I see.  I will have to fix this.
Comment 4 Brent Fox 2002-06-22 13:43:19 EDT
Ok, I've committed a fix for this in CVS.  dateconfig wasn't expecting
/etc/localtime to be a symbolic link, but dateconfig now removes /etc/localtime
and then makes a new symbolic link from /etc/localtime to /usr/share/zoneinfo/$foo

A new version should appear in Rawhide soon.  However, dateconfig has been
ported to gtk2, so there will be a lot of new packages you'll need.

Look for dateconfig-1.0.3-1.i386.rpm
Comment 5 Brent Fox 2002-12-11 15:20:59 EST
*** Bug 79429 has been marked as a duplicate of this bug. ***
Comment 6 Matt Seitz 2004-12-14 20:10:58 EST
Is a 7.3 compatible release available?
Comment 7 Matt Seitz 2004-12-15 22:11:57 EST
Created attachment 108670 [details]
Fix deletion of /usr/share/zoneinfo files

This patch fixed the problem on my system.

Note You need to log in before you can comment on or make changes to this bug.