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
This commit is contained in:
parent
9cce36182d
commit
4c9ff7f904
@ -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
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user