Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong UTC zoneinfo in cloud-images #2619

Closed
ubuntu-server-builder opened this issue May 10, 2023 · 4 comments
Closed

Wrong UTC zoneinfo in cloud-images #2619

ubuntu-server-builder opened this issue May 10, 2023 · 4 comments
Labels
launchpad Migrated from Launchpad priority Fix soon

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1543025

Launchpad details
affected_projects = ['cloud-init (Ubuntu)', 'cloud-init (Ubuntu Xenial)']
assignee = None
assignee_name = None
date_closed = 2017-03-30T21:26:07.772642+00:00
date_created = 2016-02-08T08:46:18.410930+00:00
date_fix_committed = 2017-03-30T21:26:07.772642+00:00
date_fix_released = 2017-03-30T21:26:07.772642+00:00
id = 1543025
importance = high
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1543025
milestone = None
owner = smoser
owner_name = Scott Moser
private = False
status = fix_released
submitter = smb
submitter_name = Stefan Bader
tags = []
duplicates = [1580331]

Launchpad user Stefan Bader(smb) wrote on 2016-02-08T08:46:18.410930+00:00

ADT runs use cloud-images to create test VM environments. For the Xenial cloud-images I observed a weird issue where libvirt suddenly fails its build-time tests on a time offset test on UTC.
Looking at the prepared image (cloud-init did already run there), I found that indeed a command-line of

TZ=UTC date

reports a CET based time. Looking further this seems to drill down into

/usr/share/zoneinfo/UTC -> Zulu

and that (Zulu another term for UTC) Zulu file looks quite bigger that the same on other hosts and contains the CET string as well (normal ~128b, wrong size 2335). Forcing a reinstall of tzdata will fix the file and also allows the libvirt test to pass.

So I am not sure this is wrong in the initial image base or gets in some way broken during cloud-init. Thats why I start reporting it against cloud-init.

@ubuntu-server-builder ubuntu-server-builder added launchpad Migrated from Launchpad priority Fix soon labels May 10, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Martin Pitt(pitti) wrote on 2016-02-08T09:05:56.221397+00:00

I downloaded the current amd64 cloud image and dissected it with kpartx, i. e. without booting. /usr/share/zoneinfo/Zulu is correct there, i. e. 127 bytes. So indeed it sounds like this file gets overwritten by cloud-init.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Martin Pitt(pitti) wrote on 2016-02-08T09:10:10.836177+00:00

I think the bug is here in cloudinit/distros/init.py:

def set_etc_timezone(tz, tz_file=None, tz_conf="/etc/timezone",
tz_local="/etc/localtime"):
util.write_file(tz_conf, str(tz).rstrip() + "\n")
# This ensures that the correct tz will be used for the system
if tz_local and tz_file:
util.copy(tz_file, tz_local)
return

/etc/localtime ought to be a symlink to the selected file in /usr/share/zoneinfo/, not a copy (it used to in the past due to the possibility of /usr/ being on a separate file system, but that got fixed by initramfs-tools in a better way now). So with the copy() the symlink doesn't get updated, and instead it clobbers the file in /usr/.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Launchpad Janitor(janitor) wrote on 2016-03-04T22:00:45.468632+00:00

This bug was fixed in the package cloud-init - 0.7.7~bzr1176-0ubuntu1


cloud-init (0.7.7~bzr1176-0ubuntu1) xenial; urgency=medium

  • d/README.source, d/new-upstream-snapshot: simplify the README.source
    with a script.
  • d/rules: support DEB_BUILD_OPTIONS=nocheck and remove unused code.
  • d/rules: make tests with python3
  • d/control: add pep8 as a build depends
  • d/cloud-init.preinst, d/cloud-init.postinst adjust upgrade path
    to adjust systemd jobs that put cloud-init unit jobs directly
    in multi-user.target.
  • New upstream snapshot.
    • Add Image Customization Parser for VMware vSphere Hypervisor Support.
      Disabled by default. [Sankar Tanguturi]
    • lxd: add initial support for setting up lxd using 'lxd init'
    • Handle escaped quotes in WALinuxAgentShim.find_endpoint (LP: #1488891)
    • timezone: use a symlink when updating /etc/localtime (LP: #1543025)
    • enable more code testing in 'make check'
    • Added Bigstep datasource [Daniel Watkins]
    • Enable password changing via a hashed string [Alex Sirbu]

-- Scott Moser smoser@ubuntu.com Fri, 04 Mar 2016 15:44:02 -0500

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Jon Grimm(jgrimm) wrote on 2017-03-30T21:26:31.051812+00:00

Updated status, its long been fix released in the upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad priority Fix soon
Projects
None yet
Development

No branches or pull requests

1 participant