postfix 啓動報錯

今天在啓動postfix的時候,查看centos中的postfix日誌 more /var/log/maillog,出現瞭如下報錯,

Apr 28 09:04:44 PaulV1 aliasesdb[23836]: /usr/sbin/postconf: fatal: parameter inet_interfaces: no local interface found for ::1
Apr 28 09:04:45 PaulV1 aliasesdb[23836]: newaliases: fatal: parameter inet_interfaces: no local interface found for ::1
Apr 28 09:04:45 PaulV1 postfix[23844]: fatal: parameter inet_interfaces: no local interface found for ::1

後來查看了下配置文件 vi /etc/postfix/main.cf

將配置爲:

inet_interfaces = localhost
inet_protocols = all

改成了:

inet_interfaces = all
inet_protocols = all

接着重新啓動,又出現瞭如下信息

Apr 28 09:09:08 PaulV1 postfix[23919]: postsuper: fatal: scan_dir_push: open directory defer: Permission denied
Apr 28 09:09:08 PaulV1 postfix/postsuper[23952]: fatal: scan_dir_push: open directory defer: Permission denied
Apr 28 09:09:10 PaulV1 postfix/postfix-script[23953]: fatal: Postfix integrity check failed!

這是因爲啓動時郵件服務對系統目錄沒有權限導致的,我們更改相關目錄的所有者,然後重新啓動

chown -R postfix /var/spool/postfix/

但是。啓動的時候顯示還有一個目錄沒有權限。

Apr 28 09:21:57 PaulV1 postfix/master[24146]: fatal: open lock file /var/lib/postfix/master.lock: cannot open file: Permission denied
Apr 28 09:21:58 PaulV1 postfix/master[24145]: fatal: daemon initialization failure
Apr 28 09:21:59 PaulV1 postfix/postfix-script[24147]: fatal: mail system startup failed

所以

chown -R postfix /var/lib/postfix/

最後。才啓動成功了。

[root@V1 ~]# systemctl status postfix -l       
● postfix.service - Postfix Mail Transport Agent
   Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2018-04-28 09:24:31 CST; 1min 40s ago
  Process: 24175 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS)
  Process: 24172 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
  Process: 24169 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=0/SUCCESS)
 Main PID: 24250 (master)
    Tasks: 3
   Memory: 3.6M
   CGroup: /system.slice/postfix.service
           ├─24250 /usr/libexec/postfix/master -w
           ├─24251 pickup -l -t unix -u
           └─24252 qmgr -l -t unix -u

Apr 28 09:24:31 PaulV1 systemd[1]: Starting Postfix Mail Transport Agent...
Apr 28 09:24:31 PaulV1 postfix/postfix-script[24239]: warning: not owned by group postdrop: /var/spool/postfix/public
Apr 28 09:24:31 PaulV1 postfix/postfix-script[24240]: warning: not owned by group postdrop: /var/spool/postfix/maildrop
Apr 28 09:24:31 PaulV1 postfix/postfix-script[24248]: starting the Postfix mail system
Apr 28 09:24:31 PaulV1 postfix/master[24250]: daemon started -- version 2.10.1, configuration /etc/postfix
Apr 28 09:24:31 PaulV1 systemd[1]: Started Postfix Mail Transport Agent.

參考資料:

  1. 解決沒有本地接口發現

  2. 郵件服務器啓動postfix時的問題
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章