diff options
author | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2010-04-13 22:47:34 +0000 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2010-04-13 22:47:34 +0000 |
commit | 4c9ff7f904dd29fb6fd3d29d1fa6ba1d0808a4e4 (patch) | |
tree | f17f0e683167f4ea63866125245ec05ca2e2b56a /modules/services/mail | |
parent | 9cce36182d8beb60ae9b28fa828ca0d4cc3aae51 (diff) | |
download | nixlib-4c9ff7f904dd29fb6fd3d29d1fa6ba1d0808a4e4.tar nixlib-4c9ff7f904dd29fb6fd3d29d1fa6ba1d0808a4e4.tar.gz nixlib-4c9ff7f904dd29fb6fd3d29d1fa6ba1d0808a4e4.tar.bz2 nixlib-4c9ff7f904dd29fb6fd3d29d1fa6ba1d0808a4e4.tar.lz nixlib-4c9ff7f904dd29fb6fd3d29d1fa6ba1d0808a4e4.tar.xz nixlib-4c9ff7f904dd29fb6fd3d29d1fa6ba1d0808a4e4.tar.zst nixlib-4c9ff7f904dd29fb6fd3d29d1fa6ba1d0808a4e4.zip |
Making postfix properly start on boot.
We could not start on 'filesystems', because filesystems is written as an upstart task. Additionally, as upstart calls the postfix start/stop script and it does not act as a daemon, we write it as a preStart/postStop job. Then we don't have monitoring or respawn, but at least upstart does not get confused on its state. svn path=/nixos/trunk/; revision=21061
Diffstat (limited to 'modules/services/mail')
-rw-r--r-- | modules/services/mail/postfix.nix | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/services/mail/postfix.nix b/modules/services/mail/postfix.nix index 935960286786..939260632c9b 100644 --- a/modules/services/mail/postfix.nix +++ b/modules/services/mail/postfix.nix @@ -283,11 +283,13 @@ in # accurate way is unlikely to be better. { description = "Postfix mail server"; - startOn = "started ${startingDependency} and filesystems"; + startOn = "started ${startingDependency}"; - daemonType = "fork"; + daemonType = "none"; - script = + respawn = false; + + preStart = '' if ! [ -d /var/spool/postfix ]; then ${pkgs.coreutils}/bin/mkdir -p /var/spool/mail /var/postfix/conf /var/postfix/queue @@ -309,6 +311,10 @@ in exec ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf start ''; # */ + preStop = '' + exec ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf stop + ''; + }; }; |