[SOLVED] mail gateway service pmgbanner.service + pmgpolicy.service + pmgsync.service fail to start at boot with a dynamic ip

abma

Active Member
Feb 20, 2021
89
11
28
The services fail to start at system boot:

Code:
Sep 03 10:42:58 servername pmgbanner[42970]: Use of uninitialized value $ip in concatenation (.) or string at /usr/share/perl5/PVE/Network.pm line 645.
Sep 03 10:42:58 servername pmgbanner[42970]: hostname lookup 'servername' failed - got local IP address ''


Code:
Sep 03 10:43:10 servername pmgpolicy[752]: WARNING: Use of uninitialized value $ip in concatenation (.) or string at /usr/share/perl5/PVE/Network.pm line 645.

Code:
Sep 02 17:11:16 servername pmgdb[496]: hostname lookup 'servername' failed - failed to get address info for: servername: Der Name oder der Dienst ist nicht bekannt

Code:
$ ping servername -c1
PING servername.somedomain.de (192.168.101.64) 56(84) bytes of data.
64 bytes from servername.somedomain.de (192.168.101.64): icmp_seq=1 ttl=64 time=0.013 ms

--- servername.somedomain.de ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.013/0.013/0.013/0.000 ms

proxmox-mailgateway 7.0-1


when i restart the services manually it seems to work: i guess the network/dns is up after the services are started?
 
please post:
* /etc/network/interfaces
* /etc/hostname
* /etc/hosts
* /etc/resolv.conf

that should give us a better overview where the issue might be rooted
 
/etc/network/interfaces is empty, instead:
/etc/systemd/network/50-wired-network:
Code:
[Match]
Name=e*

[Network]
DHCP=ipv4

[DHCP]
ClientIdentifier=mac
SendHostname=true
UseDomains=true

/etc/hostname:
Code:
servername

/etc/hosts:
Code:
127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

/etc/resolv.conf:
Code:
domain somedomain.de
search somedomain.de
nameserver 192.168.101.249
nameserver 192.168.101.251
 
Is the IP truly dynamic (which I'd consider odd for an smtp-server)?
If not - please add an entry to /etc/hosts pointing the short and long hostname to the ip
 
IMHO the .service are IMHO invalid, i.e.:

Code:
[Unit]
Description=Proxmox Mail Gateway Login Banner
ConditionPathExists=/usr/bin/pmgbanner
DefaultDependencies=no
After=local-fs.target
Before=console-getty.service

it should be something like:

Code:
[Unit]
Description=Proxmox Mail Gateway Login Banner
ConditionPathExists=/usr/bin/pmgbanner
DefaultDependencies=no
After=network-online.target
Wants=network-online.target

running mail gateway services without net isn't useful i guess. the documentation seems wrong: atm it requires a static network config/ip.
 
does it start successfully with your proposed changes?

yes! the failures where quiet random it seems: very likely it depends on how fast the dhcp server answers. to make the changes apply, i had to run:

Code:
for i in pmgbanner.service pmgpolicy.service pmgsync.service; do systemctl reenable $i; done;
 
Last edited: