Zitat von Victor Duchovni <victor.ducho...@morganstanley.com>:
On Fri, Feb 25, 2011 at 12:58:22AM +0100, Christian Roessner wrote:I am currently preparing an upstart script for Ubuntu. I tried several ways do use /usr/sbin/postfix, but I never would get the master PID. So I looked at the postfix.c code.There is a no single "master pid". A fully-general Postfix MTA may run multiple master instances. Postfix startup is not just a fork/exec of master(8), queue files that got renamed (perhaps restored) have to be recovered via "postsuper -s". Required "missing" directories have to be created. Basic security checks performed, all this for multiple instances. Don't run Postfix on laptops, something much simpler that drains a disk queue to a fixed SMTP smart-host is likely best for consumer machines. Do run Postfix on servers, but be prepared to not break advanced configurations, and let Postfix do its own startup and shutdown. Attempts to monitor the status of a complex multi-component Postfix MTA---as though it were a monolithic system that is either entirely up or entirely down---based on observations of a single process are likely to fail. It would be better to not monitor at all than to do it badly. I monitor Postfix by sending messages and observing their arrival or non-arrival at a monitoring sink. Automated re-start is not that interesting, the master service never crashes (not once in the last 10 years of running multiple hosts doing 2,000,000 messages a day). Automated re-start of the Postfix master(8) service is a non-problem.
The "problem" is more of that distribution like Ubuntu and Redhat are moving to "upstart" for boot and starting services/daemons. The main difference for the started services is that upstart need the program to *not* daemonize or terminate itself because status is checked directly to do respawn and other things if necessary and not by monitoring a PID like it was with sys-v. So basically to get Postfix upstart compatibel a "postfix-start-stop" helper would be needed which is always running and only does dispatching of start/stop requests to the master(s) according to Postfix needs.
Regards Andreas
smime.p7s
Description: S/MIME Cryptographic Signature