]> code.ossystems Code Review - openembedded-core.git/commitdiff
avahi: use useradd to create avahi user for avahi-daemon
authorSaul Wold <sgw@linux.intel.com>
Thu, 27 Oct 2011 14:08:40 +0000 (16:08 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 30 Jan 2012 16:27:11 +0000 (16:27 +0000)
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]
(From OE-Core rev: f0bfecc8a0af1c4c76a37a9c88f334ab6ae7e7ef)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-connectivity/avahi/avahi.inc

index c3c9c71985ec7d2107d8830e15e68adf73d9bbaa..61ff2bf530b86afcbbfa6d01e176e11f18fe6ff5 100644 (file)
@@ -14,7 +14,7 @@ SECTION = "network"
 # python scripts are under GPLv2+
 LICENSE = "GPLv2+ & LGPLv2.1+"
 
-INC_PR = "r7"
+INC_PR = "r8"
 
 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 \
@@ -114,15 +119,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`