Usage of /etc/timezone is deprecated. The tzdata maintainers recommend switching to timedatectl.
This removes the deprecated handling of /etc/timezone from the INotify module. Suggested-by: Fabian Grünbichler <[email protected]> Suggested-by: Maximiliano Sandroval <[email protected]> Tested-by: Stoiko Ivanov <[email protected]> Reviewed-by: Stoiko Ivanov <[email protected]> Signed-off-by: Stefan Mayr <[email protected]> --- src/PVE/INotify.pm | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index fdec8f1..03c871c 100644 --- a/src/PVE/INotify.pm +++ b/src/PVE/INotify.pm @@ -651,37 +651,6 @@ register_file( \&update_etc_resolv_conf, ); -# Deprecated: use PVE::Systemd::get_timezone() instead -sub read_etc_timezone { - my ($filename, $fd) = @_; - - my $timezone = <$fd>; - - chomp $timezone; - - return $timezone; -} - -# Deprecated: use PVE::Systemd::set_timezone($timezone) instead -sub write_etc_timezone { - my ($filename, $fh, $timezone) = @_; - - my $tzinfo = "/usr/share/zoneinfo/$timezone"; - - raise_param_exc({ 'timezone' => "No such timezone" }) - if (!-f $tzinfo); - - ($timezone) = $timezone =~ m/^(.*)$/; # untaint - - print $fh "$timezone\n"; - - unlink("/etc/localtime"); - symlink("/usr/share/zoneinfo/$timezone", "/etc/localtime"); - -} - -register_file('timezone', "/etc/timezone", \&read_etc_timezone, \&write_etc_timezone); - sub read_active_workers { my ($filename, $fh) = @_; -- 2.34.1
