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

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