Browse Source

hide 'setsid --help' output in emergency_shell()

When emergency_shell() happens, it does 'setsid --help' to figure out if
the setsid binary supports the '-c' flag (to set the controlling tty).

This output shows up in the logs (and on-screen if you're using
rd.debug), which keeps confusing people looking for other problems.

Using "case" instead of "strstr" lets us avoid this.
master
Will Woods 13 years ago committed by Harald Hoyer
parent
commit
3bff70ef15
  1. 2
      modules.d/99base/dracut-lib.sh

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

@ -890,7 +890,7 @@ _emergency_shell() @@ -890,7 +890,7 @@ _emergency_shell()
_ctty=/dev/$_ctty
fi
[ -c "$_ctty" ] || _ctty=/dev/tty1
strstr "$(setsid --help 2>/dev/null)" "ctty" && CTTY="-c"
case "$(/usr/bin/setsid --help 2>&1)" in *--ctty*) CTTY="--ctty";; esac
setsid $CTTY /bin/sh -i -l 0<$_ctty 1>$_ctty 2>&1
fi
}

Loading…
Cancel
Save