为什么 systemd 说 postfix 失败,而 postfix 运行正常

为什么 systemd 说 postfix 失败,而 postfix 运行正常

我们在 Debian 服务器上使用 postfix mta。一切似乎都运行良好(邮件已发送和接收),只是 systemd 说 postfix@- 服务失败:

# systemctl restart postfix@-
Job for [email protected] failed because the control process exited with error code.
See "systemctl status [email protected]" and "journalctl -xe" for details.

# systemctl --failed
  UNIT              LOAD   ACTIVE SUB    DESCRIPTION[email protected] loaded failed failed Postfix Mail Transport Agent (instance -)

这是 systemd 配置文件的结尾[电子邮件保护]

...
[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

我尝试手动运行 configure-instance.sh 和 postmulti,它们都返回状态 0

  • Debian 版本 = 靶心
  • Postfix 版本 = 3.5.6

感谢您的帮助 !

编辑更准确地说,有两个 systemd 服务:postscript 和 postscript@-

以下顺序令我感到困惑:

root@pic2s:/var/log# postfix status
...
postfix/postfix-script: the Postfix mail system is running: PID: 3341207

root@pic2s:/var/log# systemctl status postfix 
● postfix.service - Postfix Mail Transport Agent
     Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
     Active: active (exited) since Sun 2022-06-05 10:13:00 CEST; 1 day 5h ago
    Process: 3117705 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 3117705 (code=exited, status=0/SUCCESS)
        CPU: 6ms

root@pic2s:/var/log# systemctl stop postfix
root@pic2s:/var/log# postfix status
...
postfix/postfix-script: the Postfix mail system is running: PID: 3341207

总结一下:

  • postfix systemd 服务是不是标记为失败
  • 当我停止 systemd 服务时,postfix不是停止
  • 默认实例被 systemd 标记为失败

相关内容