Fix pfmount script
Sapan Bhatia [Tue, 8 May 2012 19:21:43 +0000 (15:21 -0400)]
exec/nonamespace [new file with mode: 0755]
exec/pfmount

diff --git a/exec/nonamespace b/exec/nonamespace
new file mode 100755 (executable)
index 0000000..0422218
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+# Prevent vserver from unsharing namespaces
+
+if [ ! -e /etc/vservers/$1/nonamespace ]; then
+    touch /etc/vservers/$1/nonamespace
+    if [ $? -eq 0 ]; then
+        vserver $1 stop
+        vserver $1 start
+    fi
+fi
index d94acf1..94841ef 100755 (executable)
@@ -2,11 +2,11 @@
 # Mount the planetflow directory in a slice
 
 # FIXME: if touch operation failes
-if [ ! -e /etc/vservers/nonamespace ]; then
-    touch /etc/vservers/nonamespace
+if [ ! -e /etc/vservers/$1/nonamespace ]; then
+    touch /etc/vservers/$1/nonamespace
     if [ $? -eq 0 ]; then
-        vserver pl_netflow stop
-        vserver pl_netflow start
+        vserver $1 stop
+        vserver $1 start
     fi
 fi