8 nfslock_service
="nfslock"
9 nfs_config
="/etc/sysconfig/nfs"
12 #nfs_service="nfsserver"
14 #nfs_config="/etc/sysconfig/nfs"
17 #nfs_service="nfs-kernel-server"
19 #nfs_config="/etc/default/nfs-kernel-server"
21 # Override for unit testing
22 if [ -z "$PROCFS_PATH" ] ; then
26 ##################################################
32 usage: $_c { shutdown | startup }
33 $_c { stop | start } { nfs | nlockmgr }
34 $_c { monitor-list-shares | monitor-post }
41 ##################################################
42 # Basic service stop and start
48 service
"$nfs_service" stop
49 if [ -n "$nfslock_service" ] ; then
50 service
"$nfslock_service" stop
54 if [ -n "$nfslock_service" ] ; then
55 service
"$nfslock_service" stop
57 service
"$nfs_service" stop
69 if [ -n "$nfslock_service" ] ; then
70 service
"$nfslock_service" start
72 service
"$nfs_service" start
75 if [ -n "$nfslock_service" ] ; then
76 service
"$nfslock_service" start
78 service
"$nfs_service" start
86 ##################################################
87 # service "stop" and "start" options for restarting
93 echo 0 >"${PROCFS_PATH}/fs/nfsd/threads"
94 basic_stop
"nfs" >/dev
/null
2>&1 || true
98 basic_stop
"nfslock" >/dev
/null
2>&1 || true
112 basic_start
"nfslock"
119 ##################################################
120 # service init startup and final shutdown
129 basic_stop
"nfs" || true
131 _f
="${PROCFS_PATH}/sys/net/ipv4/tcp_tw_recycle"
137 ##################################################
138 # monitor-post support
140 nfs_check_thread_count
()
142 # Load NFS configuration to get desired number of threads.
143 if [ -r "$nfs_config" ] ; then
147 # If $RPCNFSDCOUNT/$USE_KERNEL_NFSD_NUMBER isn't set then we could
148 # guess the default from the initscript. However, let's just
149 # assume that those using the default don't care about the number
150 # of threads and that they have switched on this feature in error.
151 _configured_threads
="${RPCNFSDCOUNT:-${USE_KERNEL_NFSD_NUMBER}}"
152 [ -n "$_configured_threads" ] ||
return 0
154 _threads_file
="${PROCFS_PATH}/fs/nfsd/threads"
156 # nfsd should be running the configured number of threads. If
157 # there are a different number of threads then tell nfsd the
159 read _running_threads
<"$_threads_file"
160 # Intentionally not arithmetic comparison - avoids extra errors
161 # when above fails...
162 if [ "$_running_threads" != "$_configured_threads" ] ; then
163 echo "Attempting to correct number of nfsd threads from ${_running_threads} to ${_configured_threads}"
164 echo "$_configured_threads" >"$_threads_file"
168 ##################################################
169 # list share directories
171 nfs_monitor_list_shares
()
175 sed -e 's@[[:space:]][[:space:]]*[^[:space:]()][^[:space:]()]*([^[:space:]()][^[:space:]()]*)$@@' |
179 ##################################################
193 ##################################################
209 nfs_monitor_list_shares
212 nfs_check_thread_count
217 monitor-pre|releaseip|takeip
)
218 # Not required/implemented