public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Mayr <stefan@mayr-stefan.de>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager v2 1/4] Fix #7175: replace timezone handling with systemd timedatectl
Date: Sun, 25 Jan 2026 22:01:48 +0100	[thread overview]
Message-ID: <20260125210151.1151-2-stefan@mayr-stefan.de> (raw)
In-Reply-To: <20260125210151.1151-1-stefan@mayr-stefan.de>

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@proxmox.com>
Suggested-by: Maximiliano Sandroval <m.sandoval@proxmox.com>
Signed-off-by: Stefan Mayr <stefan@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


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

  reply	other threads:[~2026-01-25 21:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-25 21:01 [pve-devel] [PATCH common, container, manager and pmg-api v2 0/4] " Stefan Mayr
2026-01-25 21:01 ` Stefan Mayr [this message]
2026-01-25 21:01 ` [pve-devel] [PATCH container v2 2/4] " Stefan Mayr
2026-01-25 21:01 ` [pve-devel] [PATCH pmg-api v2 3/4] " Stefan Mayr
2026-01-25 21:01 ` [pve-devel] [PATCH common v2 4/4] " Stefan Mayr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260125210151.1151-2-stefan@mayr-stefan.de \
    --to=stefan@mayr-stefan.de \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal