about summary refs log tree commit diff
path: root/modules/services/mail
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-06-11 21:44:06 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-06-11 21:44:06 +0000
commitb25771532af934ea18589f237cfa57da2430fea4 (patch)
tree83424c2a12da184a1037208b90e3c38068546c85 /modules/services/mail
parentdadd6d63e760ef5e3cbb57c3f9fbd5ea01f22024 (diff)
downloadnixlib-b25771532af934ea18589f237cfa57da2430fea4.tar
nixlib-b25771532af934ea18589f237cfa57da2430fea4.tar.gz
nixlib-b25771532af934ea18589f237cfa57da2430fea4.tar.bz2
nixlib-b25771532af934ea18589f237cfa57da2430fea4.tar.lz
nixlib-b25771532af934ea18589f237cfa57da2430fea4.tar.xz
nixlib-b25771532af934ea18589f237cfa57da2430fea4.tar.zst
nixlib-b25771532af934ea18589f237cfa57da2430fea4.zip
Fixing the postfix start/stop (through an upstart job script code that will
monitor the life of postfix)

Adding an assert to upstart jobs, so those with preStop will always need an exec or
script, otherwise the preStop will not be run.


svn path=/nixos/trunk/; revision=22225
Diffstat (limited to 'modules/services/mail')
-rw-r--r--modules/services/mail/postfix.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/services/mail/postfix.nix b/modules/services/mail/postfix.nix
index 939260632c9b..03c77885d069 100644
--- a/modules/services/mail/postfix.nix
+++ b/modules/services/mail/postfix.nix
@@ -287,7 +287,15 @@ in
 
         daemonType = "none";
 
-        respawn = false;
+        respawn = true;
+
+        script = ''
+          while ${pkgs.procps}/bin/ps `${pkgs.coreutils}/bin/cat /var/postfix/queue/pid/master.pid` |
+            grep -q postfix
+          do
+            ${pkgs.coreutils}/bin/sleep 1m
+          done
+        '';
 
         preStart =
           ''