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