X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fbackupninja.git;a=blobdiff_plain;f=handlers%2Fsys.in;h=455234d8bf76c0b4139eade6bad6af1ff9abaf15;hp=7b9fbb3e515ee744b9c05618e1487ad379cb3a79;hb=fd6796ad99b90371594c3068e6d8bbbdb2b1d1d5;hpb=56617bfc5bd846f660ac015d7ee349e0134c7a43 diff --git a/handlers/sys.in b/handlers/sys.in index 7b9fbb3..455234d 100755 --- a/handlers/sys.in +++ b/handlers/sys.in @@ -73,11 +73,18 @@ getconf HWINFO `which hwinfo` getconf sfdisk_options "" getconf hwinfo_options "" -# See if vservers are configured +getconf vsnames all + +# If vservers are configured, check that the ones listed in $vsnames are running. local usevserver=no -if [ $vservers_are_available = yes ] -then - info "vserver method enabled" +if [ $vservers_are_available = yes ]; then + if [ "$vsnames" = all ]; then + vsnames="$found_vservers" + fi + if ! vservers_running "$vsnames" ; then + fatal "At least one of the vservers listed in vsnames ($vsnames) is not running." + fi + info "Using vservers '$vsnames'" usevserver=yes fi @@ -91,10 +98,10 @@ if [ "$packages" == "yes" ]; then if [ $usevserver = yes ]; then info "vserver root directory set to: $VROOTDIR" - for vserver in $found_vservers; do + for vserver in $vsnames; 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