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.
_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
}