From a1f4d3d73ec8ba4cb0fd135f597824dc14444872 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Mon, 18 Oct 2010 11:03:13 -0400 Subject: [PATCH] support mounting pf directory to slicewith newer kernels --- exec/pfmount | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/exec/pfmount b/exec/pfmount index 0282c76..ade3748 100755 --- a/exec/pfmount +++ b/exec/pfmount @@ -1,10 +1,18 @@ #!/bin/sh # Mount the planetflow directory in a slice -#mount --bind /usr/local/fprobe /vservers/$1/pf -# changed from request of Faiyaz +VERSION=`uname -r | awk -F"." '{print $3}'` DEST="/vservers/$1/pf" -mount | grep "on $DEST type" > /dev/null -if [ $? -eq 1 ]; then - mount --bind /var/local/fprobe -o ro $DEST + +if [ $VERSION -ge 27 ]; then + # FIXME: ro bind mounts and namespace... + mount | grep "on $DEST type" > /dev/null + if [ $? -eq 1 ]; then + vnamespace -e pl_netflow -- mount -o bind /var/local/fprobe $DEST + fi +else + mount | grep "on $DEST type" > /dev/null + if [ $? -eq 1 ]; then + mount --bind /var/local/fprobe -o ro $DEST + fi fi -- 2.43.0