The one you reference fixes several things.  Best to merge that one.  However, 
if newaliases fails during pkg_postinst(), I believe the system will not know 
to schedule the script at first boot unless we ‘exit 1’.   We also need to 
create the sendmail link before this or do it someplace else.

Joe

From: Martin Jansa [mailto:martin.ja...@gmail.com]
Sent: Thursday, February 01, 2018 1:39 PM
To: Slater, Joseph
Cc: openembedded-devel
Subject: Re: [oe] [meta-networking][PATCH 1/1] postfix: move running newaliases 
back to pkg_postinst

How is this one related to:
https://patchwork.openembedded.org/patch/147161/
?

On Thu, Feb 1, 2018 at 10:26 PM, Joe Slater 
<joe.sla...@windriver.com<mailto:joe.sla...@windriver.com>> wrote:
newaliases, when run on the host, will fail if /var/spool/postfix
does not exist.  Run it during pkg_postinst() so that we can defer
it to first boot.

Signed-off-by: Joe Slater 
<joe.sla...@windriver.com<mailto:joe.sla...@windriver.com>>
---
 meta-networking/recipes-daemons/postfix/postfix.inc | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc 
b/meta-networking/recipes-daemons/postfix/postfix.inc
index e48fc39..d5d0789 100644
--- a/meta-networking/recipes-daemons/postfix/postfix.inc
+++ b/meta-networking/recipes-daemons/postfix/postfix.inc
@@ -217,12 +217,6 @@ do_install_append_class-native() {
 do_install_append_class-target() {
     # Remove references to buildmachine paths in target makedefs.out
     sed -i 's:-fdebug-prefix-map[^ ]*::g; 
s:--sysroot=${STAGING_DIR_TARGET}::g' ${D}/etc/postfix/makedefs.out
-    # Since we are building recipe postfix, newaliases and postmap come from 
our sysroot_native.
-    touch ${D}/etc/aliases
-    newaliases -C ${D}/etc/postfix/main.cf<http://main.cf> -oA${D}/etc/aliases
-    touch ${D}/etc/postfix/virtual_alias
-    postmap -c ${D}/etc/postfix ${D}/etc/postfix/virtual_alias
-
 }

 ALTERNATIVE_${PN} = "sendmail"
@@ -235,6 +229,7 @@ ALTERNATIVE_LINK_NAME[mailq.1] = "${mandir}/man1/mailq.1"
 ALTERNATIVE_LINK_NAME[newaliases.1] = "${mandir}/man1/newaliases.1"
 ALTERNATIVE_LINK_NAME[sendmail.1] = "${mandir}/man1/sendmail.1"

+PACKAGE_WRITE_DEPS += "postfix-native"
 pkg_postinst_${PN} () {
     if [ "x$D" = "x" ]; then
         touch /etc/aliases
@@ -248,6 +243,12 @@ pkg_postinst_${PN} () {
             # /usr/lib/sendmail is required by LSB core test
             [ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail 
$D/usr/lib/
         fi
+
+        touch $D/etc/aliases
+        # fails if /var/spool/postfix is not on host
+        newaliases -C $D/etc/postfix/main.cf<http://main.cf> -oA$D/etc/aliases 
 ||  exit 1
+        touch $D/etc/postfix/virtual_alias
+        postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
     fi
 }

--
2.7.4

--
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org<mailto:Openembedded-devel@lists.openembedded.org>
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Reply via email to