[pve-devel] [PATCH manager v2 1/4] Fix #7175: replace timezone handling with systemd timedatectl

Stefan Mayr stefan at mayr-stefan.de
Sun Jan 25 22:01:48 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>
---
 PVE/API2/Nodes.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 5bd6fe49..3de2b8c7 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -1585,7 +1585,7 @@ __PACKAGE__->register_method({
         my $ctime = time();
         my $ltime = timegm_nocheck(localtime($ctime));
         my $res = {
-            timezone => PVE::INotify::read_file('timezone'),
+            timezone => PVE::Systemd::get_timezone(),
             time => $ctime,
             localtime => $ltime,
         };
@@ -1619,7 +1619,7 @@ __PACKAGE__->register_method({
     code => sub {
         my ($param) = @_;
 
-        PVE::INotify::write_file('timezone', $param->{timezone});
+        PVE::Systemd::set_timezone($param->{timezone});
 
         return;
     },
-- 
2.34.1




More information about the pve-devel mailing list