summaryrefslogtreecommitdiff
path: root/package/nfs-utils/files/nfs.init
blob: f3866a2de41b475d257aa4ee397f28436bc15441 (plain)
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
#!/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_client:-NO}" = x"NO" && exit 0
	exec sh $0 start
	;;
start)
	mkdir -p /var/lib/nfs/rpc_pipefs
	mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
	/usr/sbin/idmapd
	/usr/sbin/gssd
	;;
stop)
	kill $(pgrep -f /usr/sbin/idmapd)
	kill $(pgrep -f /usr/sbin/gssd)
	umount /var/lib/nfs/rpc_pipefs
	;;
restart)
	sh $0 stop
	sh $0 start
	;;
*)
	echo "Usage: $0 {start | stop | restart}"
	exit 1
	;;
esac
exit $?