Skip to contentSkip to conversation

initscripts: avoid service dependency in mountnfs.sh

PATCH New Shinu Chandran 1 participant 1 message Aug 20

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 initscripts: avoid service dependency in mountnfs.sh

mountnfs.sh uses "service rpcbind status" only to avoid starting rpcbind twice before mounting remote filesystems. That pulls init-system-helpers-service into images solely to provide /usr/sbin/service.

Use start-stop-daemon test mode for the rpcbind status check instead. The script already uses start-stop-daemon to start rpcbind, so this keeps the duplicate-start protection without requiring the Debian service wrapper.

With mountnfs.sh no longer invoking service, drop init-system-helpers-service from the initscripts runtime dependencies.

---
 meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh | 3 +--
 meta/recipes-core/initscripts/initscripts_1.0.bb          | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)
meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh +1 -2
index c08597e725..53c6cfd457 100755
@@ -71,8 +71,7 @@ if test "$rpcbind" = yes
 then
 	if test -x /usr/sbin/rpcbind
 	then
-		service rpcbind status > /dev/null
-		if [ $? != 0 ]; then
+		if ! start-stop-daemon --stop --test --quiet --exec /usr/sbin/rpcbind; then
 			echo -n "Starting rpcbind..."
 			start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
 			sleep 2
meta/recipes-core/initscripts/initscripts_1.0.bb +0 -1
index ae386a6281..5e154c0a9b 100644
@@ -45,7 +45,6 @@ DEPENDS:append = " update-rc.d-native"
 PACKAGES =+ "${PN}-functions ${PN}-sushell"
 RDEPENDS:${PN} = "initd-functions \
                   ${@bb.utils.contains('DISTRO_FEATURES','selinux','${PN}-sushell','',d)} \
-                  init-system-helpers-service \
 		 "
 # Recommend pn-functions so that it will be a preferred default provider for initd-functions
 RRECOMMENDS:${PN} = "${PN}-functions"
Signature · 1 line
2.35.6