Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm setting up a CentOS machine on Amazon EC2 that should be able to send me mails.
I've configured postfix so that it uses Amazon SES service. I was under the impression that everything worked.
When I restarted the EC2-instance, I cannot get mails working.
1) sudo service postfix shows that postfix is not working
-> how can I make sure that this service is always running?
2) in /var/log/maillog I notice:
Code:
Dec 3 15:07:06 ip-xx-xx-xxx-xxx postfix/cleanup[15610]: fatal: open lock file pid/unix.cleanup: cannot open file: Permission denied
Dec 3 15:07:07 ip-xx-xx-xxx-xxx postfix/master[15396]: warning: process /usr/libexec/postfix/cleanup pid 15610 exit status 1
Dec 3 15:07:07 ip-xx-xx-xxx-xxx postfix/master[15396]: warning: /usr/libexec/postfix/cleanup: bad command startup -- throttling
If 6, the answer to your first question is chkconfig postfix on. If 7, systemctl enable postfix.
To start it up manually, sudo service postfix start or sudo systemctl start postfix.
Not sure what to do with your 2nd question. Does this appear when you shut the instance down or start it up? Will it go away once you solve question 1?
I certainly hope that mail was sending correctly at one point. It's a crime how difficult it is to set up postfix on an EC2 instance.
How did you install postfix? Did you use a package manager? Did you compile/install from source?
I'm also wondering if maybe you fired up postfix before while you were logged in as root? This might result in postfix creating certain failes (like the pid/unix.cleanup file) with permissions that are not writable by anyone but root. In my experience (which includes some CentOS but much more Ubuntu), Postfix will run as its own user. On my Ubuntu machine where I installed using apt-get (same as yum on CentOS) then postfix runs as user postfix and I can see that in /var/lib/postfix, there appear to be a couple of files that relate to postfix operation.
I did use a package manager. postfix is loaded as a service. But if I do "chkconfig postfix off" and reboot, and afterwards I start postfix manually, I still get these errors.
Code:
Dec 8 08:45:59 ip-xx-xx-xx-xx postfix/postfix-script[1511]: starting the Postfix mail system
Dec 8 08:45:59 ip-xx-xx-xx-xx postfix/master[1512]: daemon started -- version 2.6.6, configuration /etc/postfix
Dec 8 08:45:59 ip-xx-xx-xx-xx postfix/cleanup[1516]: fatal: open lock file pid/unix.cleanup: cannot open file: Permission denied
Dec 8 08:46:00 ip-xx-xx-xx-xx postfix/master[1512]: warning: process /usr/libexec/postfix/cleanup pid 1516 exit status 1
Dec 8 08:46:00 ip-xx-xx-xx-xx postfix/master[1512]: warning: /usr/libexec/postfix/cleanup: bad command startup -- throttling
I did use a package manager. postfix is loaded as a service. But if I do "chkconfig postfix off" and reboot, and afterwards I start postfix manually, I still get these errors.
Code:
Dec 8 08:45:59 ip-xx-xx-xx-xx postfix/postfix-script[1511]: starting the Postfix mail system
Dec 8 08:45:59 ip-xx-xx-xx-xx postfix/master[1512]: daemon started -- version 2.6.6, configuration /etc/postfix
Dec 8 08:45:59 ip-xx-xx-xx-xx postfix/cleanup[1516]: fatal: open lock file pid/unix.cleanup: cannot open file: Permission denied
Dec 8 08:46:00 ip-xx-xx-xx-xx postfix/master[1512]: warning: process /usr/libexec/postfix/cleanup pid 1516 exit status 1
Dec 8 08:46:00 ip-xx-xx-xx-xx postfix/master[1512]: warning: /usr/libexec/postfix/cleanup: bad command startup -- throttling
Searching the web for pid/unix.cleanup permission denied indicates that this might be an SELinux problem. On my system, unix.cleanup looks like this:
I did use a package manager. postfix is loaded as a service. But if I do "chkconfig postfix off" and reboot, and afterwards I start postfix manually, I still get these errors.
Code:
Dec 8 08:45:59 ip-xx-xx-xx-xx postfix/postfix-script[1511]: starting the Postfix mail system
Dec 8 08:45:59 ip-xx-xx-xx-xx postfix/master[1512]: daemon started -- version 2.6.6, configuration /etc/postfix
Dec 8 08:45:59 ip-xx-xx-xx-xx postfix/cleanup[1516]: fatal: open lock file pid/unix.cleanup: cannot open file: Permission denied
Dec 8 08:46:00 ip-xx-xx-xx-xx postfix/master[1512]: warning: process /usr/libexec/postfix/cleanup pid 1516 exit status 1
Dec 8 08:46:00 ip-xx-xx-xx-xx postfix/master[1512]: warning: /usr/libexec/postfix/cleanup: bad command startup -- throttling
How did you start postfix? Have you checked the permissions on the file pid/unix.cleanup?
cd /var/spool/postfix/pid
chcon -t postfix_var_run_t *
The chcon command changes the file context, -t only changes the type; i.e. the part that ends in _t.
Since there might be other files with the wrong context, you can also do this:
Code:
restorecon -irv /var/spool/postfix
This will set the correct type for all files under /var/spool/postfix. -i ignores files that aren't there (otherwise, I presume, error messages might be issued), -r means recursive, and -v verbose.
Last edited by berndbausch; 12-09-2015 at 08:01 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.