12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #!/bin/sh
- #PKG nfs-utils
- #INIT 70
- . /etc/rc.conf
- case $1 in
- autostop) ;;
- autostart)
- test x"${portmap:-NO}" = x"NO" && test x"${rpcbind:-NO}" = x"NO" && exit 0
- test x"${nfs_server:-NO}" = x"NO" && exit 0
- exec sh $0 start
- ;;
- start)
- /bin/mkdir -p /var/lib/nfs/v4recovery
- /bin/touch /var/lib/nfs/rmtab
- /bin/touch /var/lib/nfs/etab
- /bin/touch /var/lib/nfs/xtab
- /bin/touch /var/lib/nfs/sm
- chown nfs:nfs /var/lib/nfs/sm
- /usr/sbin/nfsd
- /usr/sbin/mountd
- if [ ${nfs_server_version} -eq 4 ];then
- mkdir -p /var/lib/nfs/rpc_pipefs
- mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
- /usr/sbin/idmapd
- /usr/sbin/svcgssd
- fi
- ;;
- stop)
- kill $(pgrep -f /usr/sbin/mountd)
- if [ ${nfs_server_version} -eq 4 ];then
- kill $(pgrep -f /usr/sbin/idmapd)
- kill $(pgrep -f /usr/sbin/svcgssd)
- umount /var/lib/nfs/rpc_pipefs
- fi
- ;;
- restart)
- sh $0 stop
- sh $0 start
- ;;
- *)
- echo "Usage: $0 {start | stop | restart}"
- exit 1
- ;;
- esac
- exit $?
|