sometimes (very rarely) fails to restart the service.
Add a function to restart NFSd on SLES and RHEL-like systems.
If we detect the system is unhealthy due to kNFSd not running,
try to restart the service again "service nfs restart" and
hope for the best.
CQ1019372
# check that NFS responds to rpc requests
[ "$CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK" = "yes" ] || {
- ctdb_check_rpc "NFS" 100003 3
+ (ctdb_check_rpc "NFS" 100003 3)
+ [ $? = "0" ] || {
+ echo "Trying to restart NFS service"
+ startstop_nfs restart
+ exit 1
+ }
}
# and that its directories are available
stop)
service nfsserver stop > /dev/null 2>&1
;;
+ restart)
+ service nfsserver restart
+ ;;
esac
;;
rhel)
service nfs stop > /dev/null 2>&1
service nfslock stop > /dev/null 2>&1
;;
+ restart)
+ service nfslock restart
+ service nfs restart
+ ;;
esac
;;
*)