From 9616e681a5eb600fbd7c07ea800ee4be35ee4eaa Mon Sep 17 00:00:00 2001 From: WangXiaoPeng Date: Wed, 1 Apr 2015 03:50:28 -0400 Subject: [PATCH] defect 4579: check the running of sshd at end of remoteshell, start it if needed --- xCAT/postscripts/remoteshell | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index dc9c14e22..a3895c417 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -469,4 +469,14 @@ else restartservice sshd fi +# check whether the sshd daemon has been started successfully +# As we known that for rh7 the sshd cannot be started by systemctl in chroot mode +ps aux | grep -v grep | grep sshd + +if [ $? -ne 0 ]; then + if [ -e "/usr/sbin/sshd" ]; then + /usr/sbin/sshd + fi +fi + kill -9 $CREDPID