From: S.Çağlar Onur Date: Mon, 18 Oct 2010 15:03:13 +0000 (-0400) Subject: support mounting pf directory to slicewith newer kernels X-Git-Tag: vsys-scripts-0.95-25~2 X-Git-Url: http://git.onelab.eu/?p=vsys-scripts.git;a=commitdiff_plain;h=a1f4d3d73ec8ba4cb0fd135f597824dc14444872 support mounting pf directory to slicewith newer kernels --- 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