Skip to contentSkip to conversation

ypbind-mt: set path of ypdomainname in ypbind script

PATCH New [email protected] 1 participant 1 message Nov 2, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ypbind-mt: set path of ypdomainname in ypbind script

From: Jian Liu <[email protected]>

The script ypbind will cause error if using ypdomainname command provided by busybox. So add RDEPENDCY on yp-tools and change the path of ypdomainname.

---
 meta-networking/recipes-support/nis/files/ypbind.init | 11 ++++++-----
 meta-networking/recipes-support/nis/ypbind-mt_1.38.bb |  2 ++
 2 files changed, 8 insertions(+), 5 deletions(-)
meta-networking/recipes-support/nis/files/ypbind.init +6 -5
index 244dc78..669c19c 100644
@@ -26,6 +26,7 @@
 
 YPBIND_BIN=/usr/sbin/ypbind
 pidfile=/var/run/ypbind.pid
+YPDOMAINNAME_bin=/usr/bin/ypdomainname
 
 [ -f /etc/default/ypbind ] && . /etc/default/ypbind
 
@@ -34,14 +35,14 @@ case "$1" in
 	echo -n "Starting ypbind"
 	## If the domainname is not set, skip starting of ypbind
 	## and return with "program not configured"
-        /bin/ypdomainname >/dev/null 2>&1
-        if [ $? -ne 0 -o -z "`/bin/ypdomainname 2>/dev/null`" ]; then
+        $YPDOMAINNAME_bin >/dev/null 2>&1
+        if [ $? -ne 0 -o -z "`$YPDOMAINNAME_bin 2>/dev/null`" ]; then
            if [ -f /etc/defaultdomain ]; then
              XDOMAINNAME=`cat /etc/defaultdomain`
-             /bin/ypdomainname "$XDOMAINNAME"
+             $YPDOMAINNAME_bin "$XDOMAINNAME"
 	   fi
-           /bin/ypdomainname >/dev/null 2>&1
-           if [ $? -ne 0 -o -z "`/bin/ypdomainname 2>/dev/null`" ]; then
+           $YPDOMAINNAME_bin >/dev/null 2>&1
+           if [ $? -ne 0 -o -z "`$YPDOMAINNAME_bin 2>/dev/null`" ]; then
 	     # Tell the user this has skipped
 	     echo -n " . . . . . . . . . . No domainname set"
              # service is not configured
meta-networking/recipes-support/nis/ypbind-mt_1.38.bb +2 -0
index 5702cd6..d113b82 100644
@@ -21,6 +21,8 @@ DEPENDS = " \
            yp-tools \
            ${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
           "
+RDEPENDS_${PN} += "yp-tools"
+
 # ypbind-mt now provides all the functionality of ypbind
 # and is used in place of it.
 PROVIDES += "ypbind"
Signature · 1 line
1.9.1