mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2025-07-19 15:29:08 +02:00

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>
21 lines
698 B
Bash
Executable File
21 lines
698 B
Bash
Executable File
#!/bin/sh
|
|
|
|
ALIASESDB_STAMP=/var/lib/misc/postfix.aliasesdb-stamp
|
|
|
|
make_aliasesdb() {
|
|
if [ "$(/usr/sbin/postconf -h alias_database)" = "hash:/etc/aliases" ]
|
|
then
|
|
# /etc/aliases.db may be used by other MTA, make sure nothing
|
|
# has touched it since our last newaliases call
|
|
[ /etc/aliases -nt /etc/aliases.db ] ||
|
|
[ "$ALIASESDB_STAMP" -nt /etc/aliases.db ] ||
|
|
[ "$ALIASESDB_STAMP" -ot /etc/aliases.db ] || return 0
|
|
/usr/bin/newaliases
|
|
touch -r /etc/aliases.db "$ALIASESDB_STAMP"
|
|
else
|
|
/usr/bin/newaliases
|
|
fi
|
|
}
|
|
|
|
make_aliasesdb
|