Bug#537112: mdadm: TERM error on update in --configure

martin f krafft madduck at debian.org
Wed Jul 15 07:10:59 UTC 2009


reassign 537112 lsb-base
tags 537112 patch
thanks

also sprach Arunan Balasubramaniam <arunan_bala at hotmail.com> [2009.07.15.0849 +0200]:
> Starting MD monitoring service: mdadm --monitor/sbin/mdadm already 
> running.
> /etc/init.d/mdadm: 77: TERM: parameter not set
> invoke-rc.d: initscript mdadm, action "start" failed.
> dpkg: error processing mdadm (--configure):
>  subprocess post-installation script returned error exit status 2

This is probably synaptic failing to set TERM and lsb-base requiring
it, but not using it properly in the present of set -u.

Instead of $TERM, one should always use ${TERM:-} if the variable
could be uninitialised.

This patch against /lib/lsb/init-functions should fix it. Can you
confirm?

--- /lib/lsb/init-functions     2009-03-20 17:48:36.000000000 +0100
+++ /tmp/init-functions 2009-07-15 09:10:18.000000000 +0200
@@ -188,7 +188,7 @@
 log_use_fancy_output () {
     TPUT=/usr/bin/tput
     EXPR=/usr/bin/expr
-    if [ -t 1 ] && [ "x$TERM" != "" ] && [ "x$TERM" != "xdumb" ] && [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1; then
+    if [ -t 1 ] && [ "x${TERM:-}" != "" ] && [ "x${TERM:-}" != "xdumb" ] && [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1; then
         [ -z $FANCYTTY ] && FANCYTTY=1 || true
     else
         FANCYTTY=0

-- 
 .''`.   martin f. krafft <madduck at d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
"the human brain is like an enormous fish --
 it is flat and slimy
 and has gills through which it can see."
                                                       -- monty python
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/)
URL: <http://lists.alioth.debian.org/pipermail/pkg-mdadm-devel/attachments/20090715/38b42f0e/attachment-0001.pgp>


More information about the pkg-mdadm-devel mailing list