sys: support selection of VServers to run on with the new vsnames configuration optio...
[matthijs/upstream/backupninja.git] / handlers / sys.in
index b6c7fbcb4297417dcf3f3cf258a41ff6407cd1e2..455234d8bf76c0b4139eade6bad6af1ff9abaf15 100755 (executable)
@@ -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
@@ -275,9 +282,6 @@ for x  in $(/sbin/lsmod | /bin/cut -f1 -d" " 2>/dev/null | /bin/grep -v Module 2
   catifexec "/sbin/modinfo  $x"
 done
 
-STATUS="Currently getting ksysms information:"
-catifexec "/sbin/ksyms"
-
 STATUS="Gathering information about your filesystems:"
 catiffile "/proc/filesystems"
 
@@ -288,7 +292,7 @@ STATUS="Gathering information about your partitions:"
 catiffile "/proc/partitions"
 
 STATUS="Gathering information about your ksyms:"
-catiffile "/proc/ksyms"
+catiffile "/proc/kallsyms"
 
 STATUS="Gathering information about slabinfo:"
 catiffile "/proc/slabinfo"