Postfix doesn't start on reboot

7,164

Federico, thank you very much for your help. I checked /var/log/messages and saw that on manual start, first sendmail is shut down and then postfix is started. I figured there might be some kind of sendmail/postfix conflict on restart so I did yum remove sendmail and it's all good now!

Share:
7,164

Related videos on Youtube

Amati
Author by

Amati

Updated on September 18, 2022

Comments

  • Amati
    Amati over 1 year

    I'm on CentOS 7 and as far as I understand, all that is needed for Postfix to start on reboot is to run systemctl enable postfix.service

    However, that doesn't work for me. After a reboot, systemctl status postfix produces the following:

    postfix.service - Postfix Mail Transport Agent Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled) Active: inactive (dead)

    There are no errors recorded in the error log and Postfix starts and works just fine when I do it manually. Any ideas what I'm doing wrong?

    EDIT: output from cat /etc/systemd/system/multi-user.target.wants/postfix.service

    [Unit]
    Description=Postfix Mail Transport Agent
    After=syslog.target network.target
    Conflicts=sendmail.service exim.service
    
    [Service]
    Type=forking
    PIDFile=/var/spool/postfix/pid/master.pid
    EnvironmentFile=-/etc/sysconfig/network
    ExecStartPre=-/usr/libexec/postfix/aliasesdb
    ExecStartPre=-/usr/libexec/postfix/chroot-update
    ExecStart=/usr/sbin/postfix start
    ExecReload=/usr/sbin/postfix reload
    ExecStop=/usr/sbin/postfix stop
    
    [Install]
    WantedBy=multi-user.target
    
    • Federico Sierra
      Federico Sierra over 9 years
      Please post the result of find /etc/systemd/system -name \*postfix\*
    • Amati
      Amati over 9 years
      The output is /etc/systemd/system/multi-user.target.wants/postfix.service
    • Federico Sierra
      Federico Sierra over 9 years
      Seems ok. Nothing in mail.log or messages? Is SELinux enabled? Try remove symlink /etc/systemd/system/multi-user.target.wants/postfix.service and enabled again.