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 <[email protected]>
Suggested-by: Maximiliano Sandroval <[email protected]>
Signed-off-by: Stefan Mayr <[email protected]>
---
 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
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to