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

Debian Templates: /etc/timezone being kept reset to UTC #1154

Closed
adrelanos opened this Issue Aug 29, 2015 · 10 comments

Comments

Projects
None yet
4 participants
@adrelanos
Member

adrelanos commented Aug 29, 2015

cat /etc/timezone:

UTC

cat /etc/qubes/protected-files.d/persist:

/etc/resolv.conf
/etc/hostname
/etc/hosts
/etc/localtime
/etc/timezone

Whenever I set it to Etc/UTC or something arbitrary, its being reset to UTC. It's not the /usr/lib/qubes/init/qubes-sysinit.sh script. I debugged that. [Checked it honors protected-files.d, yes, commented out the timezone modifying code.]

What else could keep setting it to UTC?

Maybe UTC is good enough for Whonix. Dunno if Etc/UTC would make a difference. Anyhow. Finding out why would be important in order to understand things.

@qubesuser

This comment has been minimized.

Show comment
Hide comment
@qubesuser

qubesuser Aug 30, 2015

Isn't the proper solution to fix Qubes to optionally not provide the configured timezone to select or all VMs?

Otherwise an exploited Whonix Workstation can access it anyway with qubesdb-read /qubes-timezone, while once that is fixed, setting the correct UTC timezone becomes automatic.

Isn't the proper solution to fix Qubes to optionally not provide the configured timezone to select or all VMs?

Otherwise an exploited Whonix Workstation can access it anyway with qubesdb-read /qubes-timezone, while once that is fixed, setting the correct UTC timezone becomes automatic.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Aug 30, 2015

Member

Yes, but this is a separate issue.

Member

adrelanos commented Aug 30, 2015

Yes, but this is a separate issue.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Aug 30, 2015

Member

Maybe some other startup service? I see systemd-timesynced.service is
started for example, it claims to have even NTP enabled...
Or something calls timedatectl (->systemd-timedated.service), some
application from /etc/xdg/autostart or so.

BTW I've found something strange - /etc is owned by user:user. Does it
happen only to me?

Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Member

marmarek commented Aug 30, 2015

Maybe some other startup service? I see systemd-timesynced.service is
started for example, it claims to have even NTP enabled...
Or something calls timedatectl (->systemd-timedated.service), some
application from /etc/xdg/autostart or so.

BTW I've found something strange - /etc is owned by user:user. Does it
happen only to me?

Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

@unman

This comment has been minimized.

Show comment
Hide comment
@unman

unman Aug 30, 2015

Member

@adrelanos
How are you setting the timezone? With dpkg-reconfigure tzdata?
It isnt clear to me when it's being reset for you - after every reboot?
I should say that I don't see this behaviour at all.

Member

unman commented Aug 30, 2015

@adrelanos
How are you setting the timezone? With dpkg-reconfigure tzdata?
It isnt clear to me when it's being reset for you - after every reboot?
I should say that I don't see this behaviour at all.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Aug 31, 2015

Member

systemd-timedated.service was already disabled. (sudo timedatectl set-ntp 0)

BTW I've found something strange - /etc is owned by user:user. Does it happen only to me?

My Whonix 11 template's /etc is also owned by user. Very strange. @nrgaway any idea?

How are you setting the timezone? With dpkg-reconfigure tzdata?

Yes, for example. But also when I manually edit some extra "xyz" or so it will be lost after reboot.

It isnt clear to me when it's being reset for you - after every reboot?

After every reboot. Otherwise it's unchanged. Whonix 11 templates. I even tried auditd to no avail.

Member

adrelanos commented Aug 31, 2015

systemd-timedated.service was already disabled. (sudo timedatectl set-ntp 0)

BTW I've found something strange - /etc is owned by user:user. Does it happen only to me?

My Whonix 11 template's /etc is also owned by user. Very strange. @nrgaway any idea?

How are you setting the timezone? With dpkg-reconfigure tzdata?

Yes, for example. But also when I manually edit some extra "xyz" or so it will be lost after reboot.

It isnt clear to me when it's being reset for you - after every reboot?

After every reboot. Otherwise it's unchanged. Whonix 11 templates. I even tried auditd to no avail.

@unman

This comment has been minimized.

Show comment
Hide comment
@unman

unman Aug 31, 2015

Member

I don't see this behaviour in the debian templates.
Unless others do - best to ask on the ml? - that would suggest that it is a whonix issue.

Member

unman commented Aug 31, 2015

I don't see this behaviour in the debian templates.
Unless others do - best to ask on the ml? - that would suggest that it is a whonix issue.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Sep 1, 2015

Member

Just checked on whonix-gw based ProxyVM:

user@host:~$ timedatectl status
      Local time: Tue 2015-09-01 22:55:30 UTC
  Universal time: Tue 2015-09-01 22:55:30 UTC
        RTC time: n/a
       Time zone: UTC (UTC, +0000)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

So probably that timedatectl set-ntp 0 doesn't work as expected or isn't executed at all.
Anyway this service can be responsible for resetting /etc/timezone (based on /etc/localtime? just guessing)

Member

marmarek commented Sep 1, 2015

Just checked on whonix-gw based ProxyVM:

user@host:~$ timedatectl status
      Local time: Tue 2015-09-01 22:55:30 UTC
  Universal time: Tue 2015-09-01 22:55:30 UTC
        RTC time: n/a
       Time zone: UTC (UTC, +0000)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

So probably that timedatectl set-ntp 0 doesn't work as expected or isn't executed at all.
Anyway this service can be responsible for resetting /etc/timezone (based on /etc/localtime? just guessing)

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Sep 1, 2015

Member

timedatectl set-ntp 1 creates /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service and timedatectl set-ntp 0 deletes it. (sudo service systemd-timesyncd status confirms it's disabled.)

That service is already disabled in my development whonix-gw based ProxyVM.

After sudo dpkg-reconfigure tzdata to something else, which works, both /etc/timezone (reset to UTC) and /etc/localtime (reset to copy of /usr/share/zoneinfo) is reset after reboot.

Member

adrelanos commented Sep 1, 2015

timedatectl set-ntp 1 creates /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service and timedatectl set-ntp 0 deletes it. (sudo service systemd-timesyncd status confirms it's disabled.)

That service is already disabled in my development whonix-gw based ProxyVM.

After sudo dpkg-reconfigure tzdata to something else, which works, both /etc/timezone (reset to UTC) and /etc/localtime (reset to copy of /usr/share/zoneinfo) is reset after reboot.

@marmarek marmarek added this to the Release 3.1 milestone Sep 5, 2015

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Sep 6, 2015

Member

This issue is exclusive to Qubes-Whonix only, which is very strange.

Member

adrelanos commented Sep 6, 2015

This issue is exclusive to Qubes-Whonix only, which is very strange.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Sep 9, 2015

Member

Fixed in the development version of Qubes-Whonix.
Even though I am sure I had the qubes-whonix postinst script disabled, it seems to no longer happen since:
Whonix/qubes-whonix@d11e428

Member

adrelanos commented Sep 9, 2015

Fixed in the development version of Qubes-Whonix.
Even though I am sure I had the qubes-whonix postinst script disabled, it seems to no longer happen since:
Whonix/qubes-whonix@d11e428

@adrelanos adrelanos closed this Sep 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment