#!/bin/sh ### BEGIN INIT INFO # Provides: statd # Required-Start: rpcbind # Should-Start: # Required-Stop: rpcbind # Should-Stop: # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: Starts statd # Description: rpc.statd provides file locking on nfs. ### END INIT INFO STATD="/sbin/rpc.statd" PIDFILE="/var/run/rpc.statd.pid" . /lib/lsb/init-functions case "$1" in start) log_init_msg "Starting NFS statd" start_daemon "$STATD" && log_success_msg || log_failure_msg ;; stop) log_init_msg "Stopping NFS statd" killproc -p "$PIDFILE" "$STATD" && log_success_msg || log_failure_msg ;; restart) $0 stop sleep 1 $0 start ;; status) pid=$(pidofproc -p "$PIDFILE" "$STATD"); if [ "$?" -ne 0 ]; then echo "NFS statd is not runing" else echo "NFS statd running with PID: $pid" fi ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac