When I have restarting the postfix server I am facing the below error ::

postfix-out/master[1714]: fatal: open lock file pid/master.pid: cannot create file exclusively: Permission denied

I having a centos server.

  • 1
    Are you running this as root?
    – Khaled
    Feb 2 '13 at 11:38
  • How exactly are you restarting it? Is there still a master process running after you try this?
    – mgorven
    Feb 5 '13 at 1:07
  • Yes I am running the service as a root.I am making an instance server but when I restart the service I am getting the error.
    – jenni
    Feb 5 '13 at 9:29

You can use this command to fix permissions on postfix files and directories.

postfix set-permissions

The file that controls these permissions is located here:


There may have been a stale master.pid file or or existing postfix process running, to clear these you could have done:

service postfix stop
pkill -9 postfix
rm -f /var/spool/pid/master.pid
postfix set-permissions
service postfix start

This file is created every time postfix starts.

In debian the file is created in /var/lib/postfix/master.lock, you have to looking for the directoyr of your postfix an check the permissions and the owners of it.

  • I have checked the permission and the permission are correct as below:: ls -ld /var/lib/postfix/master.lock -rw-------. 1 postfix postfix 33 Feb 5 11:07 /var/lib/postfix/master.lock Can you please tell me what to do next?
    – jenni
    Feb 5 '13 at 9:13
  • if postfix are not running and master.lock file exist you should delete it then postfix can create it when starts.
    – Brigo
    Feb 6 '13 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.