Disable vserver-related arcaneness
[vsys-scripts.git] / exec / pfmount
index ade3748..d94acf1 100755 (executable)
@@ -1,18 +1,16 @@
 #!/bin/sh
 # Mount the planetflow directory in a slice
 
-VERSION=`uname -r | awk -F"." '{print $3}'`
-DEST="/vservers/$1/pf"
-
-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
+# FIXME: if touch operation failes
+if [ ! -e /etc/vservers/nonamespace ]; then
+    touch /etc/vservers/nonamespace
+    if [ $? -eq 0 ]; then
+        vserver pl_netflow stop
+        vserver pl_netflow start
     fi
 fi
+
+VERSION=`uname -r | awk -F"-" '{print $1;}' | awk -F"." '{print $3}'`
+DEST="/vservers/$1/pf"
+
+mount --bind /var/local/fprobe -o ro $DEST