From 52bbff428db43698e122672edbde8a105a7a60a5 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Tue, 21 Aug 2007 18:39:03 +0000 Subject: [PATCH] Add a static context sanity check. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2593 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- scripts/vserver.functions | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/vserver.functions b/scripts/vserver.functions index 30e82f0..546cc6a 100644 --- a/scripts/vserver.functions +++ b/scripts/vserver.functions @@ -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" + } } -- 1.8.1.5