Add a static context sanity check.
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Tue, 21 Aug 2007 18:39:03 +0000 (18:39 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Tue, 21 Aug 2007 18:39:03 +0000 (18:39 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2593 94cd875c-1c1d-0410-91d2-eb244daf1a30

scripts/vserver.functions

index 30e82f0..546cc6a 100644 (file)
@@ -1080,6 +1080,15 @@ WARNING: There is no cachedirectory configured for this vserver;
 /proc/uptime can not be accessed. Usually, this is caused by
 procfs-security. Please read the FAQ for more details
 http://linux-vserver.org/Proc-Security"
+
+    test -e "$cfgdir"/context || {
+       TYPE=$( $_VSERVER_INFO 49152 XIDTYPE )
+       test "$TYPE" != "static" || panic $"\
+The kernel does not have dynamic contexts enabled. Please configure
+a static one by executing
+
+  echo [number between 2 and 49151] > $cfgdir/context"
+    }
 }