From c44515103cd5b16f8a6d0e838f166a51f8ce03e6 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Wed, 6 Jul 2016 12:12:51 +0200 Subject: [PATCH] update postfix run script --- rootfs/etc/services.d/postfix/run | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/rootfs/etc/services.d/postfix/run b/rootfs/etc/services.d/postfix/run index 1a513ca..629b840 100644 --- a/rootfs/etc/services.d/postfix/run +++ b/rootfs/etc/services.d/postfix/run @@ -1,3 +1,17 @@ #!/usr/bin/with-contenv sh -exec /usr/lib/postfix/master -d +trap "postfix stop" SIGINT +trap "postfix stop" SIGTERM +trap "postfix reload" SIGHUP + +# start postfix +postfix start + +# lets give postfix some time to start +sleep 3 + +# wait until postfix is dead (triggered by trap) +while kill -0 "`cat /var/spool/postfix/pid/master.pid`"; do + sleep 5 +done +