Merge ~raharper/cloud-init:systemd_export_tz into cloud-init:master
Proposed by
Ryan Harper
Status: | Merged |
---|---|
Merged at revision: | 4f0a2774b5e71fdc83553de7d563f7bc3db74866 |
Proposed branch: | ~raharper/cloud-init:systemd_export_tz |
Merge into: | cloud-init:master |
Diff against target: |
48 lines (+4/-0) 4 files modified
systemd/cloud-config.service (+1/-0) systemd/cloud-final.service (+1/-0) systemd/cloud-init-local.service (+1/-0) systemd/cloud-init.service (+1/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
cloud-init Commiters | Pending | ||
Review via email: mp+307722@code.launchpad.net |
Description of the change
Export TZ environment variable to systemd units
When TZ is unset in the execution environment for cloud-init, glibc
behavior of strftime will check if /etc/localtime is available via
a stat syscall. During a normal cloud-init boot, we execute roughly
400+ stat calls to /etc/localtime. Exporting TZ into the environment
prevents these stats syscalls.
To post a comment you must log in.
an alternative implementation of this would be for cloud-init to read TZ from os.environ, and if not set, then it could set it in os.environ to :/etc/localtime .
Not sure which i prefer.