Browse Source

dracut-lib.sh: bugfix for pidof function

In follow-up, the patch requires a second mod: kernel tasks have a /proc/.../exe that links to nothing and derails the for loop:
master
Stig Telfer 11 years ago committed by Harald Hoyer
parent
commit
6cc8f694b5
  1. 2
      modules.d/99base/dracut-lib.sh

2
modules.d/99base/dracut-lib.sh

@ -974,7 +974,7 @@ if ! command -v pidof >/dev/null 2>/dev/null; then
[ -z "$_cmd" ] && return 1 [ -z "$_cmd" ] && return 1
_exe=$(type -P "$1") _exe=$(type -P "$1")
for i in /proc/*/exe; do for i in /proc/*/exe; do
[ -e "$i" ] || return 1 [ -e "$i" ] || continue
if [ -n "$_exe" ]; then if [ -n "$_exe" ]; then
[ "$i" -ef "$_exe" ] || continue [ "$i" -ef "$_exe" ] || continue
else else

Loading…
Cancel
Save