From patchwork Wed Nov 2 00:21:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Pull, v3, 1/4] avahi: use useradd to create avahi user for avahi-daemon Date: Wed, 02 Nov 2011 00:21:06 -0000 From: Saul Wold X-Patchwork-Id: 14185 Message-Id: <9ef4f9a56a7d68c636768d2a1dbfeb9d6542b5f4.1320191934.git.sgw@linux.intel.com> To: openembedded-core@lists.openembedded.org DBus was failing to start correct since the avahi user was not setup. Keep the dbus reload since this could still be installed as a package an would require a dbus restart. Fixes: [YOCTO #1699] Signed-off-by: Saul Wold --- meta/recipes-connectivity/avahi/avahi.inc | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/meta/recipes-connectivity/avahi/avahi.inc b/meta/recipes-connectivity/avahi/avahi.inc index 5ad9db0..79cfd73 100644 --- a/meta/recipes-connectivity/avahi/avahi.inc +++ b/meta/recipes-connectivity/avahi/avahi.inc @@ -14,7 +14,7 @@ SECTION = "network" # python scripts are under GPLv2+ LICENSE = "GPLv2+ & LGPLv2.1+" -INC_PR = "r8" +INC_PR = "r9" DEPENDS = "expat libcap libdaemon dbus glib-2.0" @@ -23,7 +23,12 @@ SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \ file://99avahi-autoipd \ file://initscript.patch" -inherit autotools pkgconfig update-rc.d gettext +USERADD_PACKAGES = "${PN}-daemon" +USERADD_PARAM_${PN}-daemon = "--system --home /var/run/avahi-daemon \ + --no-create-home --shell /bin/false \ + --user-group avahi" + +inherit autotools pkgconfig update-rc.d gettext useradd EXTRA_OECONF = "--with-distro=debian \ --disable-introspection \ @@ -116,15 +121,12 @@ do_install_avahi-autoipd() { install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d } -# At the time the postinst runs, dbus might not be setup so only restart if running +# At the time the postinst runs, dbus might not be setup so only restart if running pkg_postinst_avahi-daemon () { - # can't do this offline if [ "x$D" != "x" ]; then - exit 1 + exit 0 fi - grep "^avahi:" /etc/group > /dev/null || addgroup avahi - grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi DBUSPID=`pidof dbus-daemon`