Skip to contentSkip to conversation

drbd-utils: drbd service: specifying commands from /sbin/ with absolute path

PATCH In review Imre Palik 2 participants 2 messages Feb 9, 2015 DRBD driver

lore
Share & tools
lore

Imre Palik

author
#0 lore raw

PATCH 1/1 drbd-utils: drbd service: specifying commands from /sbin/ with absolute path

From: "Palik, Imre" <[email protected]>

This change removes the dependance of the service on wether /sbin is in the path or not.

---
 scripts/drbd |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
scripts/drbd +5 -3
index b6b0a2c..482c69d 100755
@@ -27,6 +27,8 @@ DRBDSETUP="drbdsetup"
 PROC_DRBD="/proc/drbd"
 MODPROBE="/sbin/modprobe"
 RMMOD="/sbin/rmmod"
+UDEVADM="/sbin/udevadm"
+UDEVSETTLE="/sbin/udevsettle"
 UDEV_TIMEOUT=10
 ADD_MOD_PARAM=""
 
@@ -120,13 +122,13 @@ drbd_pretty_status()
 # But don't wait too long.
 _udev_settle()
 {
-	if udevadm version ; then
+	if $UDEVADM version ; then
 		# ok, we have udevadm, use it.
-		udevadm settle --timeout=5
+		$UDEVADM settle --timeout=5
 	else
 		# if udevsettle is not there,
 		# no matter.
-		udevsettle --timeout=5
+		$UDEVSETTLE --timeout=5
 	fi
 }
 
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw
Quoted 4 lines · Imre Palik

From: "Palik, Imre" <[email protected]>

This change removes the dependance of the service on wether /sbin is in the path or not.

If you are NOT root,
this will not work anyways.

If you ARE root,
/sbin (or your local equivalent) is supposed to be in your path.

There are deployments out there
that have these tools not in /sbin but elsewhere.

Lars