hc
2023-05-26 a23f51ed7a39e452c1037343a84d7db1ca2c5bd7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
### BEGIN INIT INFO
# Provides:          nfs-common
# Required-Start:    $portmap hwclock
# Required-Stop:     $portmap hwclock
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: NFS support for both client and server
# Description:       NFS is a popular protocol for file sharing across
#                    TCP/IP networks. This service provides various
#                    support functions for NFS mounts.
### END INIT INFO
#
# Startup script for nfs-utils
#
#
# Location of executables:
 
# Source function library.
. /etc/init.d/functions
 
test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd
test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid
#
# The default state directory is /var/lib/nfs
test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
#
#----------------------------------------------------------------------
# Startup and shutdown functions.
#  Actual startup/shutdown is at the end of this file.
 
start_statd(){
   echo -n "starting statd: "
   start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"
   echo done
}
stop_statd(){
   echo -n 'stopping statd: '
   start-stop-daemon --stop --quiet --signal 1 --pidfile "$STATD_PID"
   echo done
}
#----------------------------------------------------------------------
#
# supported options:
#  start
#  stop
#  restart: stops and starts mountd
#FIXME: need to create the /var/lib/nfs/... directories
case "$1" in
  start)
   start_statd;;
  stop)
   stop_statd;;
  status)
   status $NFS_STATD
   exit $?;;
  restart)
   $0 stop
   $0 start;;
  *)
   echo "Usage: $0 {start|stop|status|restart}"
   exit 1;;
esac