[pve-devel] [PATCH container v2 2/4] Fix #7175: replace timezone handling with systemd timedatectl
Stefan Mayr
stefan at mayr-stefan.de
Sun Jan 25 22:01:49 CET 2026
Usage of /etc/timezone is deprecated. The tzdata maintainers recommend
switching to timedatectl.
This changes the use of INotify to the Systemd module for timezone
settings.
Suggested-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
Suggested-by: Maximiliano Sandroval <m.sandoval at proxmox.com>
Signed-off-by: Stefan Mayr <stefan at mayr-stefan.de>
---
src/PVE/LXC/Setup.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
index 113093d..9dfe766 100644
--- a/src/PVE/LXC/Setup.pm
+++ b/src/PVE/LXC/Setup.pm
@@ -130,7 +130,7 @@ sub new {
# Cache some host files we need access to:
$plugin->{host_resolv_conf} = PVE::INotify::read_file('resolvconf');
- $plugin->{host_timezone} = PVE::INotify::read_file('timezone');
+ $plugin->{host_timezone} = PVE::Systemd::get_timezone();
abs_path('/etc/localtime') =~ m|^(/.+)| or die "invalid /etc/localtime\n"; # untaint
$plugin->{host_localtime} = $1;
--
2.34.1
More information about the pve-devel
mailing list