summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-daemons/postfix/files
diff options
context:
space:
mode:
authorRoy Li <rongqing.li@windriver.com>2014-11-10 13:05:37 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2014-11-10 15:18:55 -0500
commitc78eca1ea7452a62f86b740ec59f1cd39e399d73 (patch)
tree24aba8749850306ba390dcfa415787579804c8b7 /meta-networking/recipes-daemons/postfix/files
parent4b6970c24c3fb0926fd700678c0e11de43a5bf92 (diff)
downloadmeta-openembedded-c78eca1ea7452a62f86b740ec59f1cd39e399d73.tar.gz
postfix: create or update aliases.db when using systemd
aliases.db should be created by postinstall script, but failed since queue_directory is not includes root dir ${D}: ------ |newaliases: fatal: chdir /var/spool/postfix: No such file or directory ------ initscript will recall newaliases before start postfix daemon, the similar method, which run aliasesdb to create aliases.db when using systemd, is introduced to fix this issue. Signed-off-by: Roy.Li <rongqing.li@windriver.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-daemons/postfix/files')
-rwxr-xr-xmeta-networking/recipes-daemons/postfix/files/aliasesdb20
-rw-r--r--meta-networking/recipes-daemons/postfix/files/postfix.service1
2 files changed, 21 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/postfix/files/aliasesdb b/meta-networking/recipes-daemons/postfix/files/aliasesdb
new file mode 100755
index 0000000000..855a64f705
--- /dev/null
+++ b/meta-networking/recipes-daemons/postfix/files/aliasesdb
@@ -0,0 +1,20 @@
1#!/bin/sh
2
3ALIASESDB_STAMP=/var/lib/misc/postfix.aliasesdb-stamp
4
5make_aliasesdb() {
6 if [ "$(/usr/sbin/postconf -h alias_database)" = "hash:/etc/aliases" ]
7 then
8 # /etc/aliases.db may be used by other MTA, make sure nothing
9 # has touched it since our last newaliases call
10 [ /etc/aliases -nt /etc/aliases.db ] ||
11 [ "$ALIASESDB_STAMP" -nt /etc/aliases.db ] ||
12 [ "$ALIASESDB_STAMP" -ot /etc/aliases.db ] || return 0
13 /usr/bin/newaliases
14 touch -r /etc/aliases.db "$ALIASESDB_STAMP"
15 else
16 /usr/bin/newaliases
17 fi
18}
19
20make_aliasesdb
diff --git a/meta-networking/recipes-daemons/postfix/files/postfix.service b/meta-networking/recipes-daemons/postfix/files/postfix.service
index 6ea9214780..c781038d88 100644
--- a/meta-networking/recipes-daemons/postfix/files/postfix.service
+++ b/meta-networking/recipes-daemons/postfix/files/postfix.service
@@ -6,6 +6,7 @@ Conflicts=sendmail.service exim.service
6[Service] 6[Service]
7Type=forking 7Type=forking
8PIDFile=/var/spool/postfix/pid/master.pid 8PIDFile=/var/spool/postfix/pid/master.pid
9ExecStartPre=-/usr/libexec/postfix/aliasesdb
9ExecStart=/usr/sbin/postfix start 10ExecStart=/usr/sbin/postfix start
10ExecReload=/usr/sbin/postfix reload 11ExecReload=/usr/sbin/postfix reload
11ExecStop=/usr/sbin/postfix stop 12ExecStop=/usr/sbin/postfix stop