Skip to contentSkip to conversation

bind: refer ubuntu/redhat to add bind user/group

PATCH New Hongxu Jia 1 participant 2 messages Aug 19, 2014

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover bind: refer ubuntu/redhat to add bind user/group

The following changes since commit 870bb8d35547b8313b3a487d7e8b914ab9470e64:

local.conf.sample.extended: fix example for EXTRA_USERS_PARAMS (2014-08-04 17:38:24 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/bind-useradd
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/bind-useradd

Hongxu Jia (1):
bind: refer ubuntu/redhat to add bind user/group

 meta/recipes-connectivity/bind/bind/bind9    |  2 ++
 meta/recipes-connectivity/bind/bind_9.9.5.bb | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/bind/bind/bind9
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 bind: refer ubuntu/redhat to add bind user/group

We refer what ubuntu/redhat did, gave bind a user/group

Here is the example in ubuntu 14.04:

$ ps -eo user,group,cmd | grep "named"
...
bind     bind     /usr/sbin/named -u bind
...

$vim bind9_1%3a9.9.5.dfsg-3_amd64.deb/postinst
...

    # lets give them a bind user/group in all cases.
    getent group bind >/dev/null 2>&1 || addgroup --system bind
    getent passwd bind >/dev/null 2>&1 ||
    adduser --system --home /var/cache/bind --no-create-home \
        --disabled-password --ingroup bind bind
...
---
 meta/recipes-connectivity/bind/bind/bind9    |  2 ++
 meta/recipes-connectivity/bind/bind_9.9.5.bb | 10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/bind/bind/bind9
meta/recipes-connectivity/bind/bind/bind9 new file +2 -0
new file mode 100644
index 0000000..968679f
@@ -0,0 +1,2 @@
+# startup options for the server
+OPTIONS="-u bind"
meta/recipes-connectivity/bind/bind_9.9.5.bb +9 -1
index de10eb8..ebd38ef 100644
@@ -15,6 +15,7 @@ SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
            file://dont-test-on-host.patch \
            file://generate-rndc-key.sh \
            file://named.service \
+           file://bind9 \
            file://init.d-add-support-for-read-only-rootfs.patch \
 	   "
 
@@ -30,7 +31,11 @@ EXTRA_OECONF = " ${ENABLE_IPV6} --with-randomdev=/dev/random --disable-threads \
                  --with-openssl=${STAGING_LIBDIR}/.. --with-libxml2=${STAGING_LIBDIR}/.. \
                  --enable-exportlib --with-export-includedir=${includedir} --with-export-libdir=${libdir} \
                "
-inherit autotools-brokensep update-rc.d systemd
+inherit autotools-brokensep update-rc.d systemd useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home /var/cache/bind --no-create-home \
+                       --user-group bind"
 
 INITSCRIPT_NAME = "bind"
 INITSCRIPT_PARAMS = "defaults"
@@ -67,6 +72,9 @@ do_install_append() {
 	sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
 	       -e 's,@SBINDIR@,${sbindir},g' \
 	       ${D}${systemd_unitdir}/system/named.service
+
+	install -d ${D}${sysconfdir}/default
+	install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
 }
 
 CONFFILES_${PN} = " \
Signature · 1 line
1.9.1