Bug#525965: mdadm: install script returns 1

roberto_g at libero.it roberto_g at libero.it
Wed Apr 29 08:55:56 UTC 2009




On mercoledì 29 apr 2009, martin f krafft wrote:
> I am unsure whether this is a regression in debconf or not. I cannot
> reproduce the problem here at all.
>
> Does it persist if you install dash and allow it to provide the
> /bin/sh symlink?

It works!

> Could you please run the following commands and provide the output?
>
>   dpkg -l bash debconf

here it is:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Nome                          Versione                      Descrizione
+++-=============================-=============================
ii  bash                          4.0-2                         The GNU Bourne Again SHell
ii  debconf                       1.5.26                        Debian configuration management system

>
> And then I need some debug output, so please run as root:
>
>   dpkg --unpack /var/cache/apt/archives/mdadm_2.6.9-1_*.deb
>   sed -i -e '/confmodule/iset -vx' /var/lib/dpkg/info/mdadm.postinst
>   dpkg --configure mdadm

output attached


thank you,
Rob
-------------- next part --------------

root at achille:/home/rob/temp# dpkg --configure mdadm
Configuro mdadm (2.6.9-1) ...
. /usr/share/debconf/confmodule
+ . /usr/share/debconf/confmodule
#!/bin/sh
# This is a shell library to interface to the Debian configuration management
# system.

###############################################################################
# Initialization.

# Check to see if a FrontEnd is running.
if [ ! "$DEBIAN_HAS_FRONTEND" ]; then
        PERL_DL_NONLAZY=1
        export PERL_DL_NONLAZY
        # Since there is no FrontEnd, this program execs a FrontEnd.
        # It will then run a new copy of $0 that can talk to it.
        if [ "$DEBCONF_USE_CDEBCONF" ]; then
                exec /usr/lib/cdebconf/debconf $0 "$@"
        else
                exec /usr/share/debconf/frontend $0 "$@"
        fi
fi
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/mdadm.postinst configure 2.6.9-1
/usr/share/debconf/confmodule: line 65: $@: unbound variable
dpkg: errore processando mdadm (--configure):
 subprocess installed post-installation script returned error exit status 1
Sono occorsi degli errori processando:
 mdadm

root at achille:/home/rob/temp#






root at achille:/home/rob/temp# rm /bin/sh
root at achille:/home/rob/temp# ln -s /bin/dash /bin/sh
root at achille:/home/rob/temp# dpkg --configure mdadm
Configuro mdadm (2.6.9-1) ...
. /usr/share/debconf/confmodule
+ . /usr/share/debconf/confmodule
#!/bin/sh
# This is a shell library to interface to the Debian configuration management
# system.

###############################################################################
# Initialization.

# Check to see if a FrontEnd is running.
if [ ! "$DEBIAN_HAS_FRONTEND" ]; then
        PERL_DL_NONLAZY=1
        export PERL_DL_NONLAZY
        # Since there is no FrontEnd, this program execs a FrontEnd.
        # It will then run a new copy of $0 that can talk to it.
        if [ "$DEBCONF_USE_CDEBCONF" ]; then
                exec /usr/lib/cdebconf/debconf $0 "$@"
        else
                exec /usr/share/debconf/frontend $0 "$@"
        fi
fi
+ [ !  ]
+ PERL_DL_NONLAZY=1
+ export PERL_DL_NONLAZY
+ [  ]
+ exec /usr/share/debconf/frontend /var/lib/dpkg/info/mdadm.postinst configure 2.6.9-1
. /usr/share/debconf/confmodule
+ . /usr/share/debconf/confmodule
#!/bin/sh
# This is a shell library to interface to the Debian configuration management
# system.

###############################################################################
# Initialization.

# Check to see if a FrontEnd is running.
if [ ! "$DEBIAN_HAS_FRONTEND" ]; then
        PERL_DL_NONLAZY=1
        export PERL_DL_NONLAZY
        # Since there is no FrontEnd, this program execs a FrontEnd.
        # It will then run a new copy of $0 that can talk to it.
        if [ "$DEBCONF_USE_CDEBCONF" ]; then
                exec /usr/lib/cdebconf/debconf $0 "$@"
        else
                exec /usr/share/debconf/frontend $0 "$@"
        fi
fi
+ [ ! 1 ]

# Only do this once.
if [ -z "$DEBCONF_REDIR" ]; then
        # Redirect standard output to standard error. This prevents common
        # mistakes by making all the output of the postinst or whatever
        # script is using this library not be parsed as confmodule commands.
        #
        # To actually send something to standard output, send it to fd 3.
        exec 3>&1
        if [ "$DEBCONF_USE_CDEBCONF" ]; then
                exec 1>&5
        else
                exec 1>&2
        fi
        DEBCONF_REDIR=1
        export DEBCONF_REDIR
fi
+ [ -z  ]
+ exec
+ [  ]
+ exec
+ DEBCONF_REDIR=1
+ export DEBCONF_REDIR

###############################################################################
# Commands.

_db_cmd () {
        IFS=' ' printf '%s\n' "$*" >&3
        # Set to newline to get whole line.
        IFS='
' read -r _db_internal_line
        # Disgusting, but it's the only good way to split the line,
        # preserving all other whitespace.
        RET="${_db_internal_line#[!     ][      ]}"
        case ${_db_internal_line%%[     ]*} in
                1)      # escaped data
                        RET="$(printf '%s' "$RET" | debconf-escape -u)"
                        return 0
                        ;;
        esac
        return ${_db_internal_line%%[   ]*}
}

db_capb ()      { _db_cmd "CAPB $@"; }
db_set ()       { _db_cmd "SET $@"; }
db_reset ()     { _db_cmd "RESET $@"; }
db_title ()     { _db_cmd "TITLE $@"; }
db_input ()     { _db_cmd "INPUT $@"; }
db_beginblock () { _db_cmd "BEGINBLOCK $@"; }
db_endblock ()  { _db_cmd "ENDBLOCK $@"; }
db_go ()        { _db_cmd "GO $@"; }
db_get ()       { _db_cmd "GET $@"; }
db_register ()  { _db_cmd "REGISTER $@"; }
db_unregister () { _db_cmd "UNREGISTER $@"; }
db_subst ()     { _db_cmd "SUBST $@"; }
db_fset ()      { _db_cmd "FSET $@"; }
db_fget ()      { _db_cmd "FGET $@"; }
db_purge ()     { _db_cmd "PURGE $@"; }
db_metaget ()   { _db_cmd "METAGET $@"; }
db_version ()   { _db_cmd "VERSION $@"; }
db_clear ()     { _db_cmd "CLEAR $@"; }
db_settitle ()  { _db_cmd "SETTITLE $@"; }
db_previous_module () { _db_cmd "PREVIOUS_MODULE $@"; }
db_info ()      { _db_cmd "INFO $@"; }
db_progress ()  { _db_cmd "PROGRESS $@"; }
db_data ()      { _db_cmd "DATA $@"; }
db_x_loadtemplatefile ()        { _db_cmd "X_LOADTEMPLATEFILE $@"; }

# An old alias for input.
db_text () {
        db_input $@
}

# Cannot read a return code, since there is none and it would block.
db_stop () {
        echo STOP >&3
}
# See #369953 for ordering
set -eu
+ set -eu

case "${1:-}" in
  configure|reconfigure)

    if [ ! -f /proc/mdstat ] && [ -x $(command -v modprobe 2>/dev/null) ]; then
      modprobe -k md >/dev/null 2>&1 || :
    fi
    if [ ! -f /proc/mdstat ]; then
      echo 'W: mdadm: failed to load MD subsystem.' >&2
    fi

    if [ ! -e /dev/md15 ] \
      && [ ! -e /dev/.static/dev/md15 ] \
      && [ ! -e /dev/.devfsd ]; then

        echo -n 'Generating array device nodes... ' >&2
        cd /dev
        if /dev/MAKEDEV md >&2 >/dev/null; then
          echo 'done.' >&2
        else
          echo 'failed.' >&2
        fi
    fi

    DEBIANCONFIG=/etc/default/mdadm
    CONFIG=/etc/mdadm/mdadm.conf
    ALTCONFIG=/etc/mdadm.conf
    MDADM=/sbin/mdadm

    if [ -z "${2:-}" ] && [ -s /etc/mdctl/mdctl.conf ] \
        && [ ! -f /etc/mdadm/mdadm.conf ]; then
      cp -a /etc/mdctl/mdctl.conf /etc/mdadm/mdadm.conf
    fi

    # load current settings, most of which will be overwritten.
    [ -f $DEBIANCONFIG ] && . $DEBIANCONFIG

    db_get mdadm/mail_to
    MAILADDR="${RET:-root}"

    [ ! -f $CONFIG ] && [ -f $ALTCONFIG ] && CONFIG=$ALTCONFIG
    if [ ! -f $CONFIG ]; then
      echo -n 'Generating mdadm.conf... ' >&2
      # pass the MAILADDR variable into the script
      MDADM_MAILADDR__="$MAILADDR"; export MDADM_MAILADDR__
      if /usr/share/mdadm/mkconf generate $CONFIG 2>/dev/null; then
        echo done. >&2
      else
        echo "done (failed to scan arrays; /proc probably not mounted)." >&2
      fi
    elif dpkg --compare-versions "${2:-2.5.3-1}" le 2.5.3-1; then
      # we're upgrading from before 2.5.3-1 and there's apparently already
      # a configuration file which we cannot verify. We'll use the sentinel
      # during initramfs creation.
      md5sum $CONFIG > /var/lib/mdadm/CONF-UNCHECKED
    fi

    if [ -w $CONFIG ] && [ -z "${MDADM_MAILADDR__:-}" ]; then
      # if the configuration is writeable but has not been written just
      # before, then edit it to reflect the MAILADDR preference
      if grep -q '^MAILADDR' $CONFIG; then
        sed -i -e "s/^MAILADDR.*/MAILADDR $MAILADDR/" $CONFIG
      else
        echo "MAILADDR $MAILADDR" >> $CONFIG
      fi
    fi
    unset MDADM_MAILADDR__

    db_get mdadm/initrdstart
    INITRDSTART="${RET:-all}"
    db_get mdadm/autostart
    AUTOSTART="${RET:-true}"
    db_get mdadm/autocheck
    AUTOCHECK="${RET:-true}"
    db_get mdadm/start_daemon
    START_DAEMON="${RET:-true}"
    #db_get mdadm/daemon_options
    [ -n "${DAEMON_OPTIONS:-}" ] || DAEMON_OPTIONS='--syslog'

    cat <<_eof > $DEBIANCONFIG
# mdadm Debian configuration
#
# You can run 'dpkg-reconfigure mdadm' to modify the values in this file, if
# you want. You can also change the values here and changes will be preserved.
# Do note that only the values are preserved; the rest of the file is
# rewritten.
#

# INITRDSTART:
#   list of arrays (or 'all') to start automatically when the initial ramdisk
#   loads. This list *must* include the array holding your root filesystem. Use
#   'none' to prevent any array from being started from the initial ramdisk.
INITRDSTART='$INITRDSTART'

# AUTOSTART:
#   should mdadm start arrays listed in /etc/mdadm/mdadm.conf automatically
#   during boot?
AUTOSTART=$AUTOSTART

# AUTOCHECK:
#   should mdadm run periodic redundancy checks over your arrays? See
#   /etc/cron.d/mdadm.
AUTOCHECK=$AUTOCHECK

# START_DAEMON:
#   should mdadm start the MD monitoring daemon during boot?
START_DAEMON=$START_DAEMON

# DAEMON_OPTIONS:
#   additional options to pass to the daemon.
DAEMON_OPTIONS="$DAEMON_OPTIONS"

# VERBOSE:
#   if this variable is set to true, mdadm will be a little more verbose e.g.
#   when creating the initramfs.
VERBOSE=${VERBOSE:-false}

# MAIL_TO:
#   this variable is now managed in /etc/mdadm/mdadm.conf (MAILADDR).
#   Please see mdadm.conf(5).
_eof

    db_stop

    # try to undo udev rules (installed by 2.5.2-10, see 2.5.3.git200608202239-1
    # changelog). Do this before update-initramfs, which copies udev into
    # initrd.
    V=2.5.3.git200608202239-1~
    if [ "${1:-}" = "configure" ] && [ -n "${2:-}" ] \
        && dpkg --compare-versions $2 ge 2.5.2-10 \
        && dpkg --compare-versions $2 lt $V; then

      # first, disable the rules
      rm -f /etc/udev/rules.d/z60_mdadm.rules

      if echo "0843432c9c01ed95c42481eee0cf6fbf  /etc/udev/mdadm.rules" \
          | md5sum -c >/dev/null; then
        # no changes by user, so remove
        rm -f /etc/udev/mdadm.rules
      else
        echo "W: mdadm: I tried to remove /etc/udev/mdadm.rules (see changelog)," >&2
        echo "W: mdadm: but you have modified it, so I won't touch it. Please" >&2
        echo "W: mdadm: remove the file at your leisure." >&2
      fi
    fi

    command -v update-initramfs >/dev/null 2>&1 && update-initramfs -u
    ;;
esac
+ [ ! -f /proc/mdstat ]
+ [ ! -f /proc/mdstat ]
+ [ ! -e /dev/md15 ]
+ [ ! -e /dev/.static/dev/md15 ]
+ [ ! -e /dev/.devfsd ]
+ echo -n Generating array device nodes...
Generating array device nodes... + cd /dev
+ /dev/MAKEDEV md
+ echo done.
done.
+ DEBIANCONFIG=/etc/default/mdadm
+ CONFIG=/etc/mdadm/mdadm.conf
+ ALTCONFIG=/etc/mdadm.conf
+ MDADM=/sbin/mdadm
+ [ -z 2.6.9-1 ]
+ [ -f /etc/default/mdadm ]
+ . /etc/default/mdadm
# mdadm Debian configuration
#
# You can run 'dpkg-reconfigure mdadm' to modify the values in this file, if
# you want. You can also change the values here and changes will be preserved.
# Do note that only the values are preserved; the rest of the file is
# rewritten.
#

# INITRDSTART:
#   list of arrays (or 'all') to start automatically when the initial ramdisk
#   loads. This list *must* include the array holding your root filesystem. Use
#   'none' to prevent any array from being started from the initial ramdisk.
INITRDSTART='all'
+ INITRDSTART=all

# AUTOSTART:
#   should mdadm start arrays listed in /etc/mdadm/mdadm.conf automatically
#   during boot?
AUTOSTART=true
+ AUTOSTART=true

# AUTOCHECK:
#   should mdadm run periodic redundancy checks over your arrays? See
#   /etc/cron.d/mdadm.
AUTOCHECK=true
+ AUTOCHECK=true

# START_DAEMON:
#   should mdadm start the MD monitoring daemon during boot?
START_DAEMON=true
+ START_DAEMON=true

# DAEMON_OPTIONS:
#   additional options to pass to the daemon.
DAEMON_OPTIONS="--syslog"
+ DAEMON_OPTIONS=--syslog

# VERBOSE:
#   if this variable is set to true, mdadm will be a little more verbose e.g.
#   when creating the initramfs.
VERBOSE=false
+ VERBOSE=false

# MAIL_TO:
#   this variable is now managed in /etc/mdadm/mdadm.conf (MAILADDR).
#   Please see mdadm.conf(5).
+ db_get mdadm/mail_to
+ _db_cmd GET mdadm/mail_to
+ IFS=  printf %s\n GET mdadm/mail_to
+ IFS=
 read -r _db_internal_line
+ RET=rob
+ return 0
+ MAILADDR=rob
+ [ ! -f /etc/mdadm/mdadm.conf ]
+ [ ! -f /etc/mdadm/mdadm.conf ]
+ dpkg --compare-versions 2.6.9-1 le 2.5.3-1
+ [ -w /etc/mdadm/mdadm.conf ]
+ [ -z  ]
+ grep -q ^MAILADDR /etc/mdadm/mdadm.conf
+ sed -i -e s/^MAILADDR.*/MAILADDR rob/ /etc/mdadm/mdadm.conf
+ unset MDADM_MAILADDR__
+ db_get mdadm/initrdstart
+ _db_cmd GET mdadm/initrdstart
+ IFS=  printf %s\n GET mdadm/initrdstart
+ IFS=
 read -r _db_internal_line
+ RET=all
+ return 0
+ INITRDSTART=all
+ db_get mdadm/autostart
+ _db_cmd GET mdadm/autostart
+ IFS=  printf %s\n GET mdadm/autostart
+ IFS=
 read -r _db_internal_line
+ RET=true
+ return 0
+ AUTOSTART=true
+ db_get mdadm/autocheck
+ _db_cmd GET mdadm/autocheck
+ IFS=  printf %s\n GET mdadm/autocheck
+ IFS=
 read -r _db_internal_line
+ RET=true
+ return 0
+ AUTOCHECK=true
+ db_get mdadm/start_daemon
+ _db_cmd GET mdadm/start_daemon
+ IFS=  printf %s\n GET mdadm/start_daemon
+ IFS=
 read -r _db_internal_line
+ RET=true
+ return 0
+ START_DAEMON=true
+ [ -n --syslog ]
+ cat
+ db_stop
+ echo STOP
+ V=2.5.3.git200608202239-1~
+ [ configure = configure ]
+ [ -n 2.6.9-1 ]
+ dpkg --compare-versions 2.6.9-1 ge 2.5.2-10
+ dpkg --compare-versions 2.6.9-1 lt 2.5.3.git200608202239-1~
+ command -v update-initramfs
+ update-initramfs -u
update-initramfs: deferring update (trigger activated)

# remove S04 installed as a fix to #294404 as it does not work
# we only remove the startup links if the previous version was 1.9.0-2.1 (the
# one with the erroneous fix) and the S04 link exists to make sure that
# chances are minimised to overwrite admin changes (even though this would
# not affect woody upgraders)
if [ "${1:-}" = "configure" ] && [ "${2:-}" = "1.9.0-2.1" ] \
   && test -L /etc/rcS.d/S04mdadm-raid;
then
  update-rc.d -f mdadm-raid remove
fi
+ [ configure = configure ]
+ [ 2.6.9-1 = 1.9.0-2.1 ]

if [ "${1:-}" = "configure" ] && dpkg --compare-versions ${2:-2.6.7-1} lt 2.6.7-1; then
  # stop RAIDs a bit later, see #486012
  for i in 0 6; do
    test -L /etc/rc${i}.d/S50mdadm-raid && test ! -L /etc/rc${i}.d/S60mdadm-raid \
      && mv /etc/rc${i}.d/S50mdadm-raid /etc/rc${i}.d/S60mdadm-raid
  done
fi
+ [ configure = configure ]
+ dpkg --compare-versions 2.6.9-1 lt 2.6.7-1

# See #369953
set +u
+ set +u
# Automatically added by dh_installinit
if [ -x "/etc/init.d/mdadm-raid" ]; then
        update-rc.d mdadm-raid start 25 S . start 60 0 6 . >/dev/null || exit $?
fi
+ [ -x /etc/init.d/mdadm-raid ]
+ update-rc.d mdadm-raid start 25 S . start 60 0 6 .
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/mdadm" ]; then
        update-rc.d mdadm defaults 25 >/dev/null
        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
                invoke-rc.d mdadm start || exit $?
        else
                /etc/init.d/mdadm start || exit $?
        fi
fi
+ [ -x /etc/init.d/mdadm ]
+ update-rc.d mdadm defaults 25
+ which invoke-rc.d
+ [ -x /usr/sbin/invoke-rc.d ]
+ invoke-rc.d mdadm start
 * Starting MD monitoring service mdadm --monitor                                                                                    [ OK ]
# End automatically added section
# Automatically added by dh_installudev
if [ "$1" = configure ]; then
        if [ -e "/etc/udev/mdadm.vol_id.rules" ]; then
                echo "Preserving user changes to /etc/udev/rules.d/65_mdadm.vol_id.rules ..."
                if [ -e "/etc/udev/rules.d/65_mdadm.vol_id.rules" ]; then
                        mv -f "/etc/udev/rules.d/65_mdadm.vol_id.rules" "/etc/udev/rules.d/65_mdadm.vol_id.rules.dpkg-new"
                fi
                mv -f "/etc/udev/mdadm.vol_id.rules" "/etc/udev/rules.d/65_mdadm.vol_id.rules"
        fi
fi
+ [ configure = configure ]
+ [ -e /etc/udev/mdadm.vol_id.rules ]
# End automatically added section

set -u
+ set -u

# do start mdadm-raid, but don't use dh_installinit to do so, to prevent
# stopping raids on remove/upgrade.
if [ -x /etc/init.d/mdadm-raid ]; then
  if [ -x "$(command -v invoke-rc.d)" ]; then
    invoke-rc.d mdadm-raid start || exit $?
  else
    /etc/init.d/mdadm-raid start || exit $?
  fi
fi
+ [ -x /etc/init.d/mdadm-raid ]
+ command -v invoke-rc.d
+ [ -x /usr/sbin/invoke-rc.d ]
+ invoke-rc.d mdadm-raid start
 * Generating udev events for MD arrays...                                                                                           [ OK ]
Processing triggers for initramfs-tools ...
update-initramfs: Not updating initramfs.
root at achille:/home/rob/temp#


More information about the pkg-mdadm-devel mailing list