我们在某一集群中使用ISCSI+GFS2的时候,某个节点重启的时候卡在下面这个地方,直接卡死。
md: stopping all md devices.
Synchronizing SCSI cache for disk sda
根据排查发现是/etc/init.d/iscsi脚本的问题
stop()
{
rm -f /var/lock/subsys/iscsi
# If this is a final shutdown/halt, do nothing since
# lvm/dm, md, power path, etc do not always handle this
# if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
# success
# return
# fi
# don't turn off iscsi if root is possibly on a iscsi disk
rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab)
if [[ "$rootopts" =~ "_netdev" ]] ; then
echo $"Can not shutdown iSCSI. Root is on a iSCSI disk."
exit 1
fi
iscsiadm -m node --logoutall=all
/etc/init.d/iscsid stop
success
}
# if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then # success # return # 将这三行注释即可正常重启。