| mount_pipefs() { |
mount_pipefs() { |
| if grep -qs rpc_pipefs /proc/filesystems ; then |
if grep -qs rpc_pipefs /proc/filesystems ; then |
| if ! grep -qs "rpc_pipefs /var/lib/nfs/rpc_pipefs" /proc/mounts ; then |
if ! grep -qs "rpc_pipefs /var/lib/nfs/rpc_pipefs" /proc/mounts ; then |
| |
mkdir -p /var/lib/nfs/rpc_pipefs |
| ebegin "Mounting RPC pipefs" |
ebegin "Mounting RPC pipefs" |
| mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs |
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs |
| eend $? |
eend $? |
| fi |
fi |
| } |
} |
| |
|
| umount_pipefs() { |
|
| [ "${restarting}" = "yes" -o "${RC_CMD}" = "restart" ] && return 0 |
|
| if grep -qs "rpc_pipefs /var/lib/nfs/rpc_pipefs" /proc/mounts ; then |
|
| ebegin "Unmounting RPC pipefs" |
|
| umount /var/lib/nfs/rpc_pipefs |
|
| eend $? |
|
| fi |
|
| } |
|
| |
|
| mount_nfsd() { |
|
| # Make sure nfs support is loaded in the kernel #64709 |
|
| if [ -e /proc/modules ] && ! grep -qs nfsd /proc/filesystems ; then |
|
| modprobe nfsd &> /dev/null |
|
| fi |
|
| |
|
| # This is the new "kernel 2.6 way" to handle the exports file |
|
| if grep -qs nfsd /proc/filesystems ; then |
|
| if ! grep -qs "nfsd /proc/fs/nfs" /proc/mounts ; then |
|
| ebegin "Mounting nfsd filesystem in /proc" |
|
| mount -t nfsd -o nodev,noexec,nosuid nfsd /proc/fs/nfs |
|
| eend $? |
|
| fi |
|
| fi |
|
| } |
|
| |
|
| start() { |
start() { |
| mount_nfsd |
|
| mount_pipefs |
mount_pipefs |
| |
|
| ebegin "Starting idmapd" |
ebegin "Starting idmapd" |
| } |
} |
| |
|
| stop() { |
stop() { |
| local ret |
|
| |
|
| ebegin "Stopping idmapd" |
ebegin "Stopping idmapd" |
| start-stop-daemon --stop --quiet --exec ${rpc_bin} |
start-stop-daemon --stop --quiet --exec ${rpc_bin} |
| ret=$? |
eend $? |
| eend ${ret} |
|
| |
|
| umount_pipefs |
|
| |
|
| return ${ret} |
|
| } |
} |
| |
|
| restart() { |
restart() { |