aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-06-24 15:49:06 +0000
committerintrigeri <intrigeri@boum.org>2008-06-24 15:49:06 +0000
commit6c628e78f4f64680b5cec6b8062fe7e0f654043b (patch)
treeffd35eace087e31d85eb743ce46c76b2e5896db0
parentad8db347dcc0114c6d32207ecd2f00abd5d81986 (diff)
downloadbackupninja-6c628e78f4f64680b5cec6b8062fe7e0f654043b.tar.gz
backupninja-6c628e78f4f64680b5cec6b8062fe7e0f654043b.tar.bz2
lib/vserver: added vservers_running function, use it in sys handler (to ease future fix for Trac#45)
-rw-r--r--ChangeLog7
-rwxr-xr-xhandlers/sys.in2
-rw-r--r--lib/vserver.in14
3 files changed, 21 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d139bf8..b7c2a77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@ version 0.9.6 -- unreleased
. Allow the entire backup run to be halted by an action, thanks to
Matthew Palmer (Closes: #455836)
. Fixed tr construct reporting a warning (Closes: #452669)
+ lib changes
+ vserver:
+ . added vservers_running function
handler changes
dup:
. General cleanup
@@ -15,7 +18,8 @@ version 0.9.6 -- unreleased
new syntax.
. Support every duplicity-supported transport with new configuration
option desturl (Closes: #483712, #346040, Trac#2).
- . Actually allow to backup only VServers, by relaxing $include test.
+ .
+ Actually allow to backup only VServers, by relaxing $include test.
ldap:
. support HDB backend just as the BDB one, and make message clearer
when no supported backend is found (Closes: #476910)
@@ -34,6 +38,7 @@ version 0.9.6 -- unreleased
sys:
. update for 2.6 kernels: use /proc/kallsyms instead of /proc/ksyms
(Closes: Trac#39)
+ . use new vservers_running function from lib/vserver
version 0.9.5 -- December 2, 2007
backupninja changes
diff --git a/handlers/sys.in b/handlers/sys.in
index 7b9fbb3..0f863d7 100755
--- a/handlers/sys.in
+++ b/handlers/sys.in
@@ -94,7 +94,7 @@ if [ "$packages" == "yes" ]; then
for vserver in $found_vservers; do
info "examining vserver: $vserver"
# is it running ?
- $VSERVERINFO -q $vserver RUNNING
+ vservers_running $vserver
if [ $? -ne 0 ]; then
warning "The vserver $vserver is not running."
continue
diff --git a/lib/vserver.in b/lib/vserver.in
index f65bd4c..153a9b0 100644
--- a/lib/vserver.in
+++ b/lib/vserver.in
@@ -95,6 +95,20 @@ vservers_exist() {
}
##
+## If all the arguments are running vservers names, returns 0.
+## Else, returns 1. Also returns 1 if no argument is given.
+##
+vservers_running() {
+ [ $# -ge 1 ] || return 1
+ local args="$1"
+ local vserver
+ for vserver in $args ; do
+ $VSERVERINFO -q $vserver RUNNING || return 1
+ done
+ return 0
+}
+
+##
## If the argument is the name of a vserver selected by the current helper,
## echoes 'on' and returns 0.
## Else, echoes 'off' and returns 1.