summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xutils/statd/start-statd8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/statd/start-statd b/utils/statd/start-statd
index 14369e5..19e6eb2 100755
--- a/utils/statd/start-statd
+++ b/utils/statd/start-statd
@@ -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
fi
+cd /
# Fall back to launching it ourselves.
exec rpc.statd --no-notify