[pve-devel] [PATCH installer] install: set timezone, before configuring postfix
Stoiko Ivanov
s.ivanov at proxmox.com
Tue Aug 5 23:36:29 CEST 2025
quite a few changes have been made to the postfix package in trixie.
one of those is that `configure-instance.sh`, which handles
chroot-creation is now called on service startup and e.g. with
`postfix check`, which we run here[0].
this results in /etc/localtime being copied into the changeroot
before we set it to the timezone configured by the installer,
resulting in a warning upon rebooting (which would remain
until you either `dpkg-reconfigure tzdata` or `touch /etc/localtime`.
[0] https://salsa.debian.org/postfix-team/postfix-dev/-/commit/6a3cfe2931138898bea99b171c3731b17ee2fbae
Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
tested minimally with a current PBS iso - the postfix warnings after
rebooting were gone for me.
Proxmox/Install.pm | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm
index 706f7fd..9cb88bc 100644
--- a/Proxmox/Install.pm
+++ b/Proxmox/Install.pm
@@ -1295,6 +1295,12 @@ _EOD
},
);
+ # set timezone
+ my $timezone = Proxmox::Install::Config::get_timezone();
+ unlink("$targetdir/etc/localtime");
+ symlink("/usr/share/zoneinfo/$timezone", "$targetdir/etc/localtime");
+ file_write_all("$targetdir/etc/timezone", "$timezone\n");
+
unlink "$targetdir/etc/mailname";
$postfix_main_cf =~ s/__FQDN__/${hostname}.${domain}/;
file_write_all("$targetdir/etc/postfix/main.cf", $postfix_main_cf);
@@ -1309,12 +1315,6 @@ _EOD
unlink "$targetdir/proxmox_install_mode";
my $country = Proxmox::Install::Config::get_country();
- my $timezone = Proxmox::Install::Config::get_timezone();
-
- # set timezone
- unlink("$targetdir/etc/localtime");
- symlink("/usr/share/zoneinfo/$timezone", "$targetdir/etc/localtime");
- file_write_all("$targetdir/etc/timezone", "$timezone\n");
# set apt mirror
if (my $mirror = $iso_env->{locales}->{country}->{$country}->{mirror}) {
--
2.39.5
More information about the pve-devel
mailing list