From ee0deb9918f7cce2553ccfd40b9fc51d8f5dfce8 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Wed, 27 May 2009 14:21:52 +0200 Subject: [PATCH] better handling of mount moving rpc_pipefs --- modules.d/40nfsroot/nfsroot-cleanup.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules.d/40nfsroot/nfsroot-cleanup.sh b/modules.d/40nfsroot/nfsroot-cleanup.sh index 4e0d7ad..b8f3a2f 100644 --- a/modules.d/40nfsroot/nfsroot-cleanup.sh +++ b/modules.d/40nfsroot/nfsroot-cleanup.sh @@ -6,11 +6,14 @@ pid=$(pidof rpc.statd) pid=$(pidof rpcbind) [ -n "$pid" ] && kill $pid -mkdir -p +if grep -q rpc_pipefs /proc/mounts; then + # try to create the destination directory + [ -d $NEWROOT/var/lib/nfs/rpc_pipefs ] || mkdir -p $NEWROOT/var/lib/nfs/rpc_pipefs 2>/dev/null -if [ -d $NEWROOT/var/lib/nfs/rpc_pipefs ]; then - mount --move /var/lib/nfs/rpc_pipefs $NEWROOT/var/lib/nfs/rpc_pipefs -else - umount /var/lib/nfs/rpc_pipefs + if [ -d $NEWROOT/var/lib/nfs/rpc_pipefs ]; then + mount --move /var/lib/nfs/rpc_pipefs $NEWROOT/var/lib/nfs/rpc_pipefs + else + umount /var/lib/nfs/rpc_pipefs + fi fi -- 2.7.4