added 'debug' option for vshelper
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 31 Jan 2005 23:06:55 +0000 (23:06 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Mon, 31 Jan 2005 23:06:55 +0000 (23:06 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1836 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/doc/configuration.xml
util-vserver/scripts/functions
util-vserver/scripts/vshelper

index 23b9041..f5426e1 100644 (file)
@@ -78,6 +78,12 @@ When existing, the vshelper functionality will be disabled for all
 vservers.
           </description>
        </boolean>
+
+       <boolean name="debug">
+         <description>
+When existing, the vshelper execution will be traced.
+          </description>
+       </boolean>
        
        <boolean name="warning-disabled">
          <description>
@@ -549,6 +555,12 @@ When existing, the vshelper functionality will be disabled for this
 vserver.
           </description>
        </boolean>
+
+       <boolean name="debug">
+         <description>
+When existing, the vshelper execution will be traced for this vserver.
+          </description>
+       </boolean>
        
        <boolean name="warning-disabled">
          <description>
index b26e3d8..c874b14 100644 (file)
@@ -739,6 +739,18 @@ function vshelper.isEnabled
     return 0
 }
 
+function vshelper.isDebug [<vserver>]
+{
+    test ! -e "$CONFDIR"/.defaults/apps/vshelper/debug     || return 1
+    $_VSERVER_INFO - FEATURE vshelper                       || return 1
+    if test -n "$2"; then
+       local appdir=$($_VSERVER_INFO "$2" APPDIR vshelper) || return 1
+       test -z "$2" -o ! -e "$appdir/debug"                || return 1
+    fi
+
+    return 0
+}
+
 function vshelper._getHandlerInternal
 {
     local _vghi_var=$1
index ae36f6d..fc6ee6f 100755 (executable)
@@ -130,6 +130,7 @@ test "$#" -ge 2 ||
     panic $"vshelper called with missing arguments; try '--help' for more information"
 
 vshelper.isEnabled || exit 0
+! vshelper.isDebug || set -x
     
 set -eu