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
echo "ERROR: STATD is not responding. Trying to restart it. [rpc.statd $RPCSTATDOPTS]"
}
- # check that NFS is running
- service nfs status 2>/dev/null >/dev/null || {
- echo NFS is not running. Trying to restart NFS.
- ctdb_service_stop
- ctdb_service_start
+ # check that NFS responds to rpc requests
+ [ "$CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK" = "yes" ] || {
+ (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
;;
*)