O postfix só inicia depois de “systemctl daemon-reload”

2

Hoje eu atualizei o Postfix e tudo estava funcionando bem até que decidi deixar o servidor reinicializar apenas para ver se tudo voltava.

Tudo correu bem, mas o systemd parece "ignorar" a inicialização do Postfix:

Oct  7 22:59:25 [REDACTED] systemd[1]: Stopped Postfix Mail Transport Agent.
Oct  7 22:59:25 [REDACTED] systemd[1]: Stopping Postfix Mail Transport Agent...
Oct  7 22:59:25 [REDACTED] systemd[1]: Starting Postfix Mail Transport Agent...
Oct  7 22:59:25 [REDACTED] systemd[1]: Started Postfix Mail Transport Agent.

Como você pode ver, não mostra nada sobre a inicialização do Postfix que deve ser assim:

postfix: Postfix is running with backwards-compatible default settings
postfix: See http://www.postfix.org/COMPATIBILITY_README.html for details
postfix: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
postfix/postfix-script: starting the Postfix mail system

Quando eu digito

service postfix start

o processo de inicialização vai muito rápido e olhando para a lista de processos com

ps -ef

não lista nenhum serviço Postfix como pickup, tlsmgr, etc.

Agora, para corrigir isso, descobri que simplesmente tenho que recarregar o systemd com

systemctl daemon-reload

Ao usar

service postfix start
O

systemd faz o trabalho que deveria ser:

Oct  7 23:00:08 [REDACTED] systemd[1]: Reloading.
Oct  7 23:00:08 [REDACTED] systemd[1]: apt-daily-upgrade.timer: Adding 15min 23.517714s random time.
Oct  7 23:00:08 [REDACTED] systemd[1]: apt-daily.timer: Adding 3h 21min 57.996507s random time.


Oct  7 23:00:28 [REDACTED] systemd[1]: Created slice system-postfix.slice.
Oct  7 23:00:28 [REDACTED] systemd[1]: Starting Postfix Mail Transport Agent (instance -)...
Oct  7 23:00:29 [REDACTED] postfix[1233]: Postfix is running with backwards-compatible default settings
Oct  7 23:00:29 [REDACTED] postfix[1233]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Oct  7 23:00:29 [REDACTED] postfix[1233]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Oct  7 23:00:30 [REDACTED] postfix/postfix-script[1333]: starting the Postfix mail system
Oct  7 23:00:30 [REDACTED] postfix/master[1335]: daemon started -- version 3.1.6, configuration /etc/postfix
Oct  7 23:00:30 [REDACTED] systemd[1]: Started Postfix Mail Transport Agent (instance -).

Quando eu reinicio, tenho que recarregar o systemd novamente para que o Postfix funcione através do comando service. Este é um comportamento muito estranho e não encontrei nenhuma resposta para isso na internet.

Especificações do sistema:

CPU: CPU Intel (R) Xeon (R) E5-2670 v3 a 2.30GHz
Memória: 12 GB
SSD: 240 GB
SO: Debian 9 Stretch (64 bits)
Todos os pacotes estão atualizados.
Virtualizado com o KVM.

postfix.service

[Unit]
Description=Postfix Mail Transport Agent
Conflicts=sendmail.service exim4.service
ConditionPathExists=/etc/postfix/main.cf

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecReload=/bin/true

[Install]
WantedBy=multi-user.target

postfix @ .service

[Unit]
Description=Postfix Mail Transport Agent (instance %i)
Documentation=man:postfix(1)
PartOf=postfix.service
Before=postfix.service
ReloadPropagatedFrom=postfix.service
After=network-online.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
GuessMainPID=no
ExecStartPre=/usr/lib/postfix/configure-instance.sh %i
ExecStart=/usr/sbin/postmulti -i %i -p start
ExecStop=/usr/sbin/postmulti -i %i -p stop
ExecReload=/usr/sbin/postmulti -i %i -p reload

[Install]
WantedBy=multi-user.target

Eu tentei corrigir isso com

systemctl enable postfix.service

mas isso também não funcionou.

Obrigado pela sua ajuda!

EDIT: Ok, isso é muito estranho: o serviço "networking" falha ao "elevar as interfaces de rede". Mas quando executo ifconfig , a interface IPv4 e IPv6 está funcionando corretamente.

Okt 10 20:48:43 [REDACTED] ifup[423]: ifup: failed to bring up eth0
Okt 10 20:48:43 [REDACTED] systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Okt 10 20:48:43 [REDACTED] systemd[1]: Failed to start Raise network interfaces.
Okt 10 20:48:43 [REDACTED] systemd[1]: networking.service: Unit entered failed state.
Okt 10 20:48:43 [REDACTED] systemd[1]: networking.service: Failed with result 'exit-code'.

Toquei em interfaces somente uma vez atribuindo IPs a eles 14 meses atrás.

    
por Sergen S. 09.10.2017 / 17:04

3 respostas

2

Ok, o que finalmente me ajudou foi esse simples comando:

systemctl enable postfix@-

Após a reinicialização, tudo é iniciado corretamente.

    
por 14.10.2017 / 15:10
1

Eu tenho o mesmo problema. Parece ser um bug após a atualização do trecho 9.1 para o trecho 9.2: link

Você tentou reinstalar o postfix conforme descrito lá? Isso não ajudou no meu sistema, mas talvez você tenha mais sorte.

    
por 10.10.2017 / 12:20
0

Seu postfix é vinculado apenas a determinados endereços IP (a opção inet_interfaces )? Em caso afirmativo, há vários bugs relatados relacionados à falha na inicialização - consulte 882141 e 887992 (como mencionado por Barit ).

    
por 08.01.2018 / 21:39