blob: 1d8b902ba66c006570d6fc45ea459547df671c02 [file] [log] [blame]
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# rpc_pipefs - NFSv4 rpc_pipefs mounter
# mounts/unmounts the rpc_pipefs filesystem on /var/lib/nfs/rpc_pipefs
# this is needed by gssd and idmapd and the mount will not happen if
# these are not running / used
# This is modified from Ubuntu's rpc_pipefs.conf
description "Mount the rpc_pipefs filesystem for NFSv4"
author "chromium-os-dev@chromium.org"
#console output
start on (starting gssd or starting idmapd)
stop on (stopped gssd and stopped idmapd)
env PIPEFS_MOUNTPOINT=/var/lib/nfs/rpc_pipefs
pre-start script
. /etc/init/lib/nfs-check-setup
if [ "$NEED_IDMAPD" != "yes" ] && [ "$NEED_GSSD" != "yes" ]; then
stop
exit 0
fi
modprobe -q sunrpc || true
# Make sure we have the rpc_pipefs filesystem
grep -qs rpc_pipefs /proc/filesystems || return 1
# If things are already mounted, let's just return
grep -qs "rpc_pipefs $PIPEFS_MOUNTPOINT" /proc/mounts && return 0
mkdir -p $PIPEFS_MOUNTPOINT
mount -t rpc_pipefs rpc_pipefs "$PIPEFS_MOUNTPOINT"
end script
post-stop script
# Unmount, but only if mounted
grep -qs "rpc_pipefs $PIPEFS_MOUNTPOINT" /proc/mounts && umount "$PIPEFS_MOUNTPOINT"
end script