All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Stig Telfer <stelfer-WVYJKLFxKCc@public.gmane.org>,
	"initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCHv2] dracut-lib.sh: bugfix for pidof function
Date: Tue, 28 Jan 2014 15:37:27 +0100	[thread overview]
Message-ID: <52E7C0A7.9050100@redhat.com> (raw)
In-Reply-To: <E86DFAF410366A40AD1683994061D9D608FE12-aOe8g7e11MUSZAcGdq5asVgOPcOSbvolAL8bYrjMMd8@public.gmane.org>

On 01/24/2014 04:48 PM, Stig Telfer wrote:
> 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
> 
> --
> To unsubscribe from this list: send the line "unsubscribe initramfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Thanks! Pushed.

      parent reply	other threads:[~2014-01-28 14:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52E7C0A7.9050100@redhat.com \
    --to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=stelfer-WVYJKLFxKCc@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.