← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~raharper/cloud-init:systemd_export_tz into cloud-init:master

 

$ ./go 
lrwxrwxrwx 1 root root 36 Nov  7 08:43 /etc/localtime -> /usr/share/zoneinfo/America/New_York
== -u TZ ==
open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 3
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3545, ...}) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3545, ...}) = 0
2016-11-21 11:12:25.758464

== TZ=US/Eastern ==
open("/usr/share/zoneinfo/US/Eastern", O_RDONLY|O_CLOEXEC) = 3
2016-11-21 11:12:25.855751

== TZ=Invalid ==
open("/usr/share/zoneinfo/Invalid", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
2016-11-21 16:12:25.943840

== TZ= ==
open("/usr/share/zoneinfo/Universal", O_RDONLY|O_CLOEXEC) = 3
2016-11-21 16:12:26.024612

== TZ=:/etc/localtime ==
open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 3
2016-11-21 11:12:26.108717

== TZ=:/etc/localtime.bogus ==
open("/etc/localtime.bogus", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
2016-11-21 16:12:26.191718



$ cat go
#!/bin/sh
runit() { "$@" python3 -c 'from datetime import datetime; print(datetime.now())'; }
ls -l /etc/localtime
for p in "-u TZ" "TZ=US/Eastern" "TZ=Invalid" TZ= "TZ=:/etc/localtime" "TZ=:/etc/localtime.bogus"; do
   echo == $p ==
   runit env $p strace 2>&1 | egrep "((open|stat).*etc/localtime|zoneinfo)"
   runit env $p
   echo
done

-- 
https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/307722
Your team cloud init development team is requested to review the proposed merge of ~raharper/cloud-init:systemd_export_tz into cloud-init:master.


References