From 9271e58a24a80b00ec57e9f4ed99ddd2ed80e3e0 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 1 Oct 2010 18:09:43 -0400 Subject: older versions (lenny) of lvm2 have a bug in vgcfgbackup that makes it so when you specify multiple volume groups to backup, it gives an error, saying you must set the %s template for the name. We are doing that, it just cannot handle it properly. This change routes around this issue, which has been fixed in later lvm2 releases, by passing only one argument to vgcfgbackup by taking all the volume groups that are found and running them through a for loop --- handlers/sys.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'handlers/sys.in') diff --git a/handlers/sys.in b/handlers/sys.in index a92663e..fcf3e31 100755 --- a/handlers/sys.in +++ b/handlers/sys.in @@ -649,8 +649,11 @@ function doLvmBackup () { debug "$VGS --options vg_name --noheadings | @SED@ 's/^[ ]*//' | @SED@ 's/[ ]*$//' | tr '\n' ' '" vgs=`$VGS --options vg_name --noheadings | @SED@ 's/^[ ]*//' | @SED@ 's/[ ]*$//' | tr '\n' ' '` debug "Let's try to backup LVM metadata for detected volume groups: $vgs" - debug "$VGCFGBACKUP --file \"${lvmdir}\"/\'%s\' $vgs" - output=`$VGCFGBACKUP --file "${lvmdir}"/'%s' $vgs` + for vg in $vgs + do + debug "$VGCFGBACKUP --file \"${lvmdir}\"/\'%s\' $vg" + output=`$VGCFGBACKUP --file "${lvmdir}"/'%s' $vg` + done exit_code=$? debug $output case $exit_code in -- cgit v1.2.3 From 6aca9c822b640372b0fad24d2a3a288ef2cd6a0f Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 25 Apr 2011 18:55:58 +0200 Subject: All handlers: stop using "local VAR" outside functions. (Closes: #530647) --- ChangeLog | 2 ++ handlers/dup.in | 2 +- handlers/mysql.in | 4 ++-- handlers/pgsql.in | 4 ++-- handlers/rdiff.in | 2 +- handlers/svn.in | 4 ++-- handlers/sys.in | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) (limited to 'handlers/sys.in') diff --git a/ChangeLog b/ChangeLog index 2a94593..29ce38d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ version 0.9.9 -- UNRELEASED action. Thanks to Olivier Berger for the patch. (Closes: #511300) handler changes + all handlers: + . Stop using "local VAR" outside functions. (Closes: #530647) dup: . Use --tempdir option rather than TMPDIR environment variable. (Closes Roundup bug #598) diff --git a/handlers/dup.in b/handlers/dup.in index e3475b8..1d345a3 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -51,7 +51,7 @@ fi ### VServers # If vservers are configured, check that the ones listed in $vsnames do exist. -local usevserver=no +usevserver=no if [ $vservers_are_available = yes ]; then if [ "$vsnames" = all ]; then vsnames="$found_vservers" diff --git a/handlers/mysql.in b/handlers/mysql.in index 05ea396..185a98a 100644 --- a/handlers/mysql.in +++ b/handlers/mysql.in @@ -24,8 +24,8 @@ getconf configfile /etc/mysql/debian.cnf # Decide if the handler should operate on a vserver or on the host. # In the former case, check that $vsname exists and is running. -local usevserver=no -local vroot +usevserver=no +vroot='' if [ $vservers_are_available = yes ]; then if [ -n "$vsname" ]; then # does it exist ? diff --git a/handlers/pgsql.in b/handlers/pgsql.in index ff71ebc..a50d3c7 100644 --- a/handlers/pgsql.in +++ b/handlers/pgsql.in @@ -15,8 +15,8 @@ localhost=`hostname` # Decide if the handler should operate on a vserver or on the host. # In the former case, check that $vsname exists and is running. -local usevserver=no -local vroot +usevserver=no +vroot='' if [ $vservers_are_available = yes ]; then if [ -n "$vsname" ]; then # does it exist ? diff --git a/handlers/rdiff.in b/handlers/rdiff.in index e391edd..c2f5aa0 100644 --- a/handlers/rdiff.in +++ b/handlers/rdiff.in @@ -115,7 +115,7 @@ fi ### CHECK CONFIG ### # If vservers are configured, check that the ones listed in $vsnames do exist. -local usevserver=no +usevserver=no if [ $vservers_are_available = yes ]; then if [ "$vsnames" = all ]; then vsnames="$found_vservers" diff --git a/handlers/svn.in b/handlers/svn.in index 5e5531a..bb70eee 100644 --- a/handlers/svn.in +++ b/handlers/svn.in @@ -14,8 +14,8 @@ error=0 # Decide if the handler should operate on a vserver or on the host. # In the former case, check that $vsname exists and is running. -local usevserver=no -local vroot +usevserver=no +vroot='' if [ $vservers_are_available = yes ]; then if [ -n "$vsname" ]; then # does it exist ? diff --git a/handlers/sys.in b/handlers/sys.in index fcf3e31..101745c 100755 --- a/handlers/sys.in +++ b/handlers/sys.in @@ -103,7 +103,7 @@ getconf lvm no getconf vsnames all # If vservers are configured, check that the ones listed in $vsnames are running. -local usevserver=no +usevserver=no if [ $vservers_are_available = yes ]; then if [ "$vsnames" = all ]; then vsnames="$found_vservers" -- cgit v1.2.3 From d32cc2318ce6cc6fc634ef73b97d0bbebf2feea3 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 5 May 2011 09:16:59 +0200 Subject: sys: fix hwinfo (Closes: #625501) --- ChangeLog | 2 ++ handlers/sys.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'handlers/sys.in') diff --git a/ChangeLog b/ChangeLog index ad5ba59..2157afb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,8 @@ version 0.9.9 -- UNRELEASED . Fix long rotation. . Make units clearer (Closes Redmine bug #2737) . Do arithmetic using bash rather than bc (Closes: #603173) + sys: + . Fix hwinfo (Closes: #625501) tar: . Install by default. (Closes Redmine bug #2907) helper changes diff --git a/handlers/sys.in b/handlers/sys.in index 101745c..12d8f59 100755 --- a/handlers/sys.in +++ b/handlers/sys.in @@ -542,7 +542,7 @@ fi # if [ "$hardware" == "yes" ]; then - if [ "dohwinfo" == "yes" ]; then + if [ "$dohwinfo" == "yes" ]; then if [ -f $hardwarefile ]; then rm $hardwarefile fi -- cgit v1.2.3 From 49a5c563211685d00cd8de0a195ae26972c52bbd Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 15 May 2011 19:19:48 +0200 Subject: sys: fix gathering of information about loaded modules. cut is in /usr/bin actually. --- ChangeLog | 2 ++ handlers/sys.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'handlers/sys.in') diff --git a/ChangeLog b/ChangeLog index 2157afb..87bf36b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,6 +37,8 @@ version 0.9.9 -- UNRELEASED . Do arithmetic using bash rather than bc (Closes: #603173) sys: . Fix hwinfo (Closes: #625501) + . Fix gathering of information about loaded modules: + cut is in /usr/bin actually. tar: . Install by default. (Closes Redmine bug #2907) helper changes diff --git a/handlers/sys.in b/handlers/sys.in index 12d8f59..74133a3 100755 --- a/handlers/sys.in +++ b/handlers/sys.in @@ -350,7 +350,7 @@ STATUS="Getting kernel version:" catifexec "/bin/uname" "-a" STATUS="Checking module information:" catifexec "/sbin/lsmod" -for x in $(/sbin/lsmod | /bin/cut -f1 -d" " 2>/dev/null | /bin/grep -v Module 2>/dev/null +for x in $(/sbin/lsmod | /usr/bin/cut -f1 -d" " 2>/dev/null | /bin/grep -v Module 2>/dev/null ) ; do STATUS="Checking module information $x:" catifexec "/sbin/modinfo" "$x" -- cgit v1.2.3