From ac75c245e6d5cad23aae1dc42de0db4ba81df616 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Fri, 3 Feb 2023 02:25:09 +0100 Subject: [PATCH] Fix EL9 chroot detection EL9 shows the following message: Running in chroot, ignoring command ... Previously this was: Running in chroot, ignoring request ... Truncate regex to detect both. --- xCAT/postscripts/xcatlib.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/xcatlib.sh b/xCAT/postscripts/xcatlib.sh index 5ea888fcb..c4c8b4bea 100755 --- a/xCAT/postscripts/xcatlib.sh +++ b/xCAT/postscripts/xcatlib.sh @@ -430,7 +430,7 @@ function startservice { local retmsg retmsg=`$cmd 2>&1` retval=$? - [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring request.*" >/dev/null 2>&1) && retval=1 + [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring .*" >/dev/null 2>&1) && retval=1 return $retval } @@ -474,7 +474,7 @@ function stopservice { local retmsg retmsg=`$cmd 2>&1` retval=$? - [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring request.*" >/dev/null 2>&1) && retval=1 + [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring .*" >/dev/null 2>&1) && retval=1 return $retval } @@ -522,7 +522,7 @@ function restartservice { #In the chrooted env, the system management commands(start/stop/restart) will be ignored and the return code is 0 #need to return the proper code in the chrooted scenario - [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring request.*" >/dev/null 2>&1) && retval=1 + [ "$retval" = "0" ] && (echo "$retmsg" | grep -i "Running in chroot,\s*ignoring .*" >/dev/null 2>&1) && retval=1 return $retval }