mkinitrd unification across distributions
 help / color / mirror / Atom feed
* [PATCHv2] dracut-lib.sh: bugfix for pidof function
@ 2014-01-24 15:48 Stig Telfer
       [not found] ` <E86DFAF410366A40AD1683994061D9D608FE12-aOe8g7e11MUSZAcGdq5asVgOPcOSbvolAL8bYrjMMd8@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Stig Telfer @ 2014-01-24 15:48 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

In follow-up, the patch requires a second mod: kernel tasks have a /proc/.../exe that links to nothing and derails the for loop:

diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh
index 85f7cdf..05fb1e4 100755
--- a/modules.d/99base/dracut-lib.sh
+++ b/modules.d/99base/dracut-lib.sh
@@ -967,9 +967,9 @@ if ! command -v pidof >/dev/null 2>/dev/null; then
         [ -z "$_cmd" ] && return 1
         _exe=$(type -P "$1")
         for i in /proc/*/exe; do
-            [ -e "$i" ] || return 1
+            [ -e "$i" ] || continue
             if [ -n "$_exe" ]; then
-                [ "$i" -ef "$_cmd" ] || continue
+                [ "$i" -ef "$_exe" ] || continue
             else
                 _rl=$(readlink -f "$i");
                 [ "${_rl%/$_cmd}" != "$_rl" ] || continue

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-28 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-24 15:48 [PATCHv2] dracut-lib.sh: bugfix for pidof function Stig Telfer
     [not found] ` <E86DFAF410366A40AD1683994061D9D608FE12-aOe8g7e11MUSZAcGdq5asVgOPcOSbvolAL8bYrjMMd8@public.gmane.org>
2014-01-28 14:37   ` Harald Hoyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox