I am trying to use supervisord to control postfix. The usual method is to specify a command which starts the daemon, I use postfix -c /etc/postfix start. The postfix man page says that to stop you replace start with stop in the above command.
I do not see a way of specifying another command to stop a daemon, just a signal. The master manpage says that the TERM signal will function as if postfix abort was used but is silent on shutting down gracefully via a signal.
Also, the start/stop method of the first paragraph is tricky as far as supervisord is concerned. The script performs a bunch of checks and then invokes master, qmgr and pickup with master as the process group leader. Thus, supervisord has a handle on a useless PID (one the script was running as) and cannot therefore use that PID to stop the daemon. What it should have a handle to is the master process.
How far I've got:
[program:master]
process_name = master
priority = 5
directory = /etc/postfix
command = /usr/sbin/postfix -c /etc/postfix start
startsecs = 0
user = root
stopsignal = INT
This starts postfix but cannot stop it.

