initscripts: just try to mount rpc_pipefs always

Do not rely on modprobe.d hacks to mount the filesystem after loading the module.
Mount the filesystem directly. The kernel will ask for the module if needed.

This avoids race conditions between the initscripts running in parallel and it
works with built-in sunrpc too.

Later we can consider passing the responsibility to mount rpc_pipefs
to a systemd {auto,}mount unit pair.

https://bugzilla.redhat.com/show_bug.cgi?id=702707

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Michal Schmidt 2011-05-17 11:39:06 -04:00 committed by J. Bruce Fields
parent 6176ed1379
commit d37883f482
3 changed files with 5 additions and 52 deletions

View File

@ -58,23 +58,8 @@ case "$1" in
[ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
# Make sure the rpc_pipefs filesystem is available
[ "${RPCMTAB}" != "noload" ] && {
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
if ! /sbin/lsmod | grep sunrpc > /dev/null ; then
/sbin/modprobe sunrpc
fi
}
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && { \
echo "Error: RPC MTAB does not exist."
exit 6
}
}
}
/bin/mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs > /dev/null 2>&1
[ "${SECURE_NFS_MODS}" != "noload" ] && {
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
for i in ${SECURE_NFS_MODS}; do

View File

@ -57,23 +57,7 @@ case "$1" in
echo -n $"Starting RPC idmapd: "
# Make sure the rpc_pipefs filesystem is available
[ "${RPCMTAB}" != "noload" ] && {
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
if ! /sbin/lsmod | grep sunrpc > /dev/null ; then
/sbin/modprobe sunrpc
fi
}
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && { \
echo "Error: RPC MTAB does not exist."
exit 6
}
}
}
/bin/mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs > /dev/null 2>&1
# Start daemon.
daemon $prog ${RPCIDMAPDARGS}

View File

@ -50,25 +50,9 @@ case "$1" in
# List of kernel modules to load
[ -z "${SECURE_NFS_MODS}" ] && SECURE_NFS_MODS="des rpcsec_gss_krb5"
# Make sure the rpc_pipefs filesystem is available
[ "${RPCMTAB}" != "noload" ] && {
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && {
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
if ! /sbin/lsmod | grep sunrpc > /dev/null ; then
/sbin/modprobe sunrpc
fi
}
RPCMTAB=`grep -v '^#' /proc/mounts | \
awk '{ if ($3 ~ /^rpc_pipefs$/ ) print $2}'`
[ -z "${RPCMTAB}" ] && { \
echo "Error: RPC MTAB does not exist."
exit 6
}
}
}
/bin/mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs > /dev/null 2>&1
[ "${SECURE_NFS_MODS}" != "noload" ] && {
[ -x /sbin/lsmod -a -x /sbin/modprobe ] && {
# Load rpcsec modules