defect 4579: check the running of sshd at end of remoteshell, start it if needed

This commit is contained in:
WangXiaoPeng 2015-04-01 03:50:28 -04:00
parent 48ae224911
commit 9616e681a5

View File

@ -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