aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-06-25 09:21:11 +0000
committerintrigeri <intrigeri@boum.org>2008-06-25 09:21:11 +0000
commitddce1197cb096e360e51e38c9a9f742424be71ff (patch)
tree3c99c2bc437647b734bcf69be061edd1d5b93b88 /handlers
parentedeb50c7336373cd37fb102e008245b3c86ba73b (diff)
downloadbackupninja-ddce1197cb096e360e51e38c9a9f742424be71ff.tar.gz
backupninja-ddce1197cb096e360e51e38c9a9f742424be71ff.tar.bz2
sys: make debconf-get-selections detection on VServers really more robust
Diffstat (limited to 'handlers')
-rwxr-xr-xhandlers/sys.in13
1 files changed, 11 insertions, 2 deletions
diff --git a/handlers/sys.in b/handlers/sys.in
index 24ebbe1..83ed7b5 100755
--- a/handlers/sys.in
+++ b/handlers/sys.in
@@ -116,7 +116,7 @@ if [ "$packages" == "yes" ]; then
continue
fi
# is $packagemgr available inside $vserver ?
- if [ ! -x "$VROOTDIR/$vserver`$VSERVER $vserver exec which $packagemgr`" ]; then
+ if [ ! -x "${VROOTDIR}/${vserver}${packagemgr}" ]; then
warning "can't find $packagemgr in vserver $vserver, skipping installed packages report."
else
# don't expand * since it can be used in $packagemgroptions
@@ -126,12 +126,21 @@ if [ "$packages" == "yes" ]; then
set +o noglob
fi
# is $debconfgetselections available inside $vserver ?
- if [ -z "`$VSERVER $vserver exec which debconf-get-selections`" ]; then
+ found=no
+ # case #1: it is available on the host, is it available inside $vserver ?
+ if [ -n "$debconfgetselections" ]; then
+ [ -x "${VROOTDIR}/${vserver}${debconfgetselections}" ] && found=yes
+ # case #2: it is not available on the host, is it available inside $vserver ?
+ else
+ [ -n "`$VSERVER $vserver exec which debconf-get-selections`" ] && found=yes
+ fi
+ if [ "$found" != yes ]; then
warning "can't find debconf-get-selections in vserver $vserver, skipping package selection states."
else
debug "$VSERVER $vserver exec $debconfgetselections > $VROOTDIR/$vserver$selectionsfile"
$VSERVER $vserver exec $debconfgetselections > $VROOTDIR/$vserver$selectionsfile || fatal "can not save debconf-get-selections info to $selectionsfile"
fi
+ unset found
done
fi