Blame SOURCES/0099-dracut-lib.sh-bugfix-for-pidof-function.patch

18971c
From 2f117f4db3425229f9a9b107682ad05b8ba613ea Mon Sep 17 00:00:00 2001
18971c
From: Stig Telfer <stelfer@cray.com>
18971c
Date: Fri, 24 Jan 2014 15:48:32 +0000
18971c
Subject: [PATCH] dracut-lib.sh: bugfix for pidof function
18971c
18971c
In follow-up, the patch requires a second mod: kernel tasks have a /proc/.../exe that links to nothing and derails the for loop:
18971c
---
18971c
 modules.d/99base/dracut-lib.sh | 2 +-
18971c
 1 file changed, 1 insertion(+), 1 deletion(-)
18971c
18971c
diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
18971c
index 61e5a81a..d892c26d 100755
18971c
--- a/modules.d/99base/dracut-lib.sh
18971c
+++ b/modules.d/99base/dracut-lib.sh
18971c
@@ -967,7 +967,7 @@ if ! command -v pidof >/dev/null 2>/dev/null; then
18971c
         [ -z "$_cmd" ] && return 1
18971c
         _exe=$(type -P "$1")
18971c
         for i in /proc/*/exe; do
18971c
-            [ -e "$i" ] || return 1
18971c
+            [ -e "$i" ] || continue
18971c
             if [ -n "$_exe" ]; then
18971c
                 [ "$i" -ef "$_exe" ] || continue
18971c
             else