blob: 0dc417246252a7a82948fc88a8c2d138f1d4ed4c [file] [log] [blame]
diff -up nfs-utils-1.3.0/utils/statd/start-statd.orig nfs-utils-1.3.0/utils/statd/start-statd
--- nfs-utils-1.3.0/utils/statd/start-statd.orig 2016-04-14 14:16:47.608999000 -0400
+++ nfs-utils-1.3.0/utils/statd/start-statd 2016-04-26 11:04:26.019962000 -0400
@@ -1,4 +1,4 @@
-#!/bin/bash -p
+#!/bin/sh
# nfsmount calls this script when mounting a filesystem with locking
# enabled, but when statd does not seem to be running (based on
# /var/run/rpc.statd.pid).
@@ -6,11 +6,19 @@
# site.
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+if [ -s /var/run/rpc.statd.pid ] &&
+ [ 1`cat /var/run/rpc.statd.pid` -gt 1 ] &&
+ kill -0 `cat /var/run/rpc.statd.pid` > /dev/null 2>&1
+then
+ # statd already running - must have been slow to respond.
+ exit 0
+fi
# First try systemd if it's installed.
if [ -d /run/systemd/system ]; then
- # Quit only if the call worked.
- systemctl start rpc-statd.service && exit
+ # Quit only if the call worked.
+ systemctl start rpc-statd.service && exit
fi
+cd /
# Fall back to launching it ourselves.
exec rpc.statd --no-notify