0

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.

3
  • 1
    Are you running this as root?
    – Khaled
    Feb 2, 2013 at 11:38
  • How exactly are you restarting it? Is there still a master process running after you try this?
    – mgorven
    Feb 5, 2013 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, 2013 at 9:29

2 Answers 2

2

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:

/etc/postfix/postfix-files

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
1

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.

2
  • 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, 2013 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, 2013 at 11:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .