postfix.sh 407 B

123456789101112131415161718
  1. #!/bin/bash
  2. # http://superuser.com/questions/168412/using-supervisord-to-control-the-postfix-mta
  3. trap "postfix stop" SIGINT
  4. trap "postfix stop" SIGTERM
  5. trap "postfix reload" SIGHUP
  6. # start postfix
  7. postfix -c /opt/postfix/conf start
  8. # lets give postfix some time to start
  9. sleep 3
  10. # wait until postfix is dead (triggered by trap)
  11. while kill -0 $(cat /var/spool/postfix/pid/master.pid); do
  12. sleep 5
  13. done