Skip to content

Commit

Permalink
Skip statd service on node startup if it's already running
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcary authored and saikat-royc committed Jun 22, 2021
1 parent 7e76a30 commit 4fad6ee
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion deploy/kubernetes/nfs_services_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ set -o errexit
trap "{ exit 0 }" TERM

service rpcbind start
service nfs-common start

# If statd is already running, for example becuase of an existing nfs mount, we will fail
# to service nfs-common start. If we successfully query the statd service (rpc program
# number 100024), that means it's running, and we don't need to start it. This command
# is put in /etc/default/nfs-common as the NEED_STATD variable must be set there.

if rpcinfo -T udp 127.0.0.1 100024; then
echo statd already running
echo NEED_STATD=no >> /etc/default/nfs-common
else
echo no statd found
fi

service nfs-common start

sleep infinity

0 comments on commit 4fad6ee

Please sign in to comment.