Patchwork [CONSOLIDATED,PULL,16/18] avahi: use useradd to create user

login
register
mail settings
Submitter Saul Wold
Date Oct. 27, 2011, 10:06 p.m.
Message ID <b15e1f6d38f9e0bce6ea9bea4745bc64a37ba56c.1319753141.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/13955/
State New, archived
Headers show

Comments

Saul Wold - Oct. 27, 2011, 10:06 p.m.
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/recipes-connectivity/avahi/avahi.inc |   22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)

Patch

diff --git a/meta/recipes-connectivity/avahi/avahi.inc b/meta/recipes-connectivity/avahi/avahi.inc
index 5ad9db0..4abe0e8 100644
--- a/meta/recipes-connectivity/avahi/avahi.inc
+++ b/meta/recipes-connectivity/avahi/avahi.inc
@@ -23,7 +23,10 @@  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 = "--disabled-password --system --home /var/run/avahi-daemon --no-create-home -user-group avahi"
+
+inherit autotools pkgconfig update-rc.d gettext useradd
 
 EXTRA_OECONF = "--with-distro=debian \
              --disable-introspection \
@@ -116,23 +119,6 @@  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
-
-pkg_postinst_avahi-daemon () {
-	# can't do this offline
-	if [ "x$D" != "x" ]; then
-		exit 1
-	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`
-
-	if [ "x$DBUSPID" != "x" ]; then
-		/etc/init.d/dbus-1 force-reload
-	fi
-}
-
 pkg_postinst_avahi-autoipd () {
 	# can't do this offline
 	if [ "x$D" != "x" ]; then