a56a5e
From 37a18fda1146ac619165af8dbbbda3cbfb8ad18b Mon Sep 17 00:00:00 2001
966cef
From: Stig Telfer <stelfer@cray.com>
966cef
Date: Fri, 24 Jan 2014 15:19:11 +0000
966cef
Subject: [PATCH] dracut-lib.sh: bugfix for pidof function
966cef
966cef
It appears there is a simple substitution error in the pidof shell function which causes it to fail to find processes.  In my case, processes started by 95nfs are not terminated in the cleanup hook.  This causes knock-on effects disturbing the root filesystem service dependencies.
966cef
966cef
Enjoy,
966cef
Stig Telfer
966cef
---
966cef
 modules.d/99base/dracut-lib.sh | 2 +-
966cef
 1 file changed, 1 insertion(+), 1 deletion(-)
966cef
966cef
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
1755ca
index cd628519..61e5a81a 100755
966cef
--- a/modules.d/99base/dracut-lib.sh
966cef
+++ b/modules.d/99base/dracut-lib.sh
966cef
@@ -969,7 +969,7 @@ if ! command -v pidof >/dev/null 2>/dev/null; then
966cef
         for i in /proc/*/exe; do
966cef
             [ -e "$i" ] || return 1
966cef
             if [ -n "$_exe" ]; then
966cef
-                [ "$i" -ef "$_cmd" ] || continue
966cef
+                [ "$i" -ef "$_exe" ] || continue
966cef
             else
966cef
                 _rl=$(readlink -f "$i");
966cef
                 [ "${_rl%/$_cmd}" != "$_rl" ] || continue