summaryrefslogtreecommitdiff
blob: 2816503f304b3355b74784d32c4900e6da90459f (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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-fs/idmapd/files/idmapd.rc,v 1.3 2004/06/09 17:40:02 vapier Exp $

depend() {
	need net
}

start() {
	if grep -q rpc_pipefs /proc/filesystems &>/dev/null; then
		if ! grep -q "rpc_pipefs /var/lib/rpc_pipes" /proc/mounts &>/dev/null; then
			ebegin "Mounting RPC pipefs"
			mkdir -p /var/lib/rpc_pipes
			mount -t rpc_pipefs rpc_pipefs /var/lib/rpc_pipes
			eend $? "Error mounting RPC pipefs"
		fi
	fi

	ebegin "Starting idmapd"
	/sbin/idmapd -p /var/lib/rpc_pipes ${IDMAPD_OPTS}
	eend $?
}

stop() {
	ebegin "Stopping idmapd"
	start-stop-daemon --stop --quiet --exec /sbin/idmapd
	eend $?

	ebegin "Unmounting RPC pipefs"
	umount /var/lib/rpc_pipes
	eend $? "Error unmounting RPC pipefs"
}