From 3373d861ddf49f31ae5bb8ce67a9769053d67860 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Mon, 31 Jan 2005 23:06:55 +0000 Subject: [PATCH] added 'debug' option for vshelper git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1836 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/doc/configuration.xml | 12 ++++++++++++ util-vserver/scripts/functions | 12 ++++++++++++ util-vserver/scripts/vshelper | 1 + 3 files changed, 25 insertions(+) diff --git a/util-vserver/doc/configuration.xml b/util-vserver/doc/configuration.xml index 23b9041..f5426e1 100644 --- a/util-vserver/doc/configuration.xml +++ b/util-vserver/doc/configuration.xml @@ -78,6 +78,12 @@ When existing, the vshelper functionality will be disabled for all vservers. + + + +When existing, the vshelper execution will be traced. + + @@ -549,6 +555,12 @@ When existing, the vshelper functionality will be disabled for this vserver. + + + +When existing, the vshelper execution will be traced for this vserver. + + diff --git a/util-vserver/scripts/functions b/util-vserver/scripts/functions index b26e3d8..c874b14 100644 --- a/util-vserver/scripts/functions +++ b/util-vserver/scripts/functions @@ -739,6 +739,18 @@ function vshelper.isEnabled return 0 } +function vshelper.isDebug [] +{ + 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 diff --git a/util-vserver/scripts/vshelper b/util-vserver/scripts/vshelper index ae36f6d..fc6ee6f 100755 --- a/util-vserver/scripts/vshelper +++ b/util-vserver/scripts/vshelper @@ -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 -- 1.8.1.5