From 3bff70ef15dbda8b89ff5e998c79f6492e58b1ae Mon Sep 17 00:00:00 2001 From: Will Woods Date: Tue, 28 Aug 2012 09:43:52 -0400 Subject: [PATCH] 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. --- modules.d/99base/dracut-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index 60b4cb17..fbe6f914 100755 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -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 }