diff --git a/modules.d/95nfs/nfsroot-cleanup.sh b/modules.d/95nfs/nfsroot-cleanup.sh index e3b3d173..b801d8c4 100644 --- a/modules.d/95nfs/nfsroot-cleanup.sh +++ b/modules.d/95nfs/nfsroot-cleanup.sh @@ -1,3 +1,7 @@ +rpcpipefspath=`cat /tmp/nfs.rpc_pipefs_path` + +[ -z "$rpcpipefspath" ] && rpcpipefspath=var/lib/nfs/rpc_pipefs + pid=$(pidof rpc.statd) [ -n "$pid" ] && kill $pid @@ -9,10 +13,10 @@ pid=$(pidof rpcbind) if incol2 /proc/mounts /var/lib/nfs/rpc_pipefs; 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 + [ -d $NEWROOT/$rpcpipefspath ] || mkdir -p $NEWROOT/$rpcpipefspath 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 + if [ -d $NEWROOT/$rpcpipefspath ]; then + mount --move /var/lib/nfs/rpc_pipefs $NEWROOT/$rpcpipefspath else umount /var/lib/nfs/rpc_pipefs fi