Your message dated Sun, 28 Oct 2012 18:47:28 +0000
with message-id <e1tsxtq-0002rr...@franck.debian.org>
and subject line Bug#684708: fixed in mdadm 3.2.5-4+mdmon
has caused the Debian Bug report #684708,
regarding mdadm: support external metadata arrays correctly
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
684708: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684708
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: mdadm
Version: 3.2.5-1
Severity: serious
Tags: patch wheezy sid

The initramfs hook supplied by mdadm doesn't install mdmon. Also, mdmon
is not included in the .udeb for the installer.

This means that if you have an array with external metadata (ddf or,
more widely used, imsm - Intel Matrix Raid) that it will come up
readonly. This causes the installer to hang or the system not being
able to boot if root is on that array.

The attached patch does a couple of things:

- it makes sure mdadm is included in the initramfs and the udeb package
- it adds a mdadm-waitidle script that runs just before reboot/halt. For all
  arrays that are still running, it sets safe_mode_delay to a low version,
  sets sync_action to idle, and waits for the array(s) to go idle.
  This is needed so that the array is clean, otherwise it will start
  to resync at the next boot.
- it adds 2 lines of code to mdmon.c so that it symlinks its pidfile
  into /run/sendsigs.omit.d - mdmon should not be killed at shutdown,
  we still need it after the rootfs has been unmounted.

I have added support for installation on Intel Matrix raid (imsm)
arrays using mdadm to d-i, and I'll be sending patches to the debian-boot
list soon. Please consider this patch for inclusion in wheezy.

Mike.
Binary files orig/mdadm-3.2.5/debian/.rules.swp and mdadm-3.2.5/debian/.rules.swp differ
diff -ruN orig/mdadm-3.2.5/debian/changelog mdadm-3.2.5/debian/changelog
--- orig/mdadm-3.2.5/debian/changelog	2012-05-25 20:05:23.000000000 +0200
+++ mdadm-3.2.5/debian/changelog	2012-08-06 23:30:04.171100029 +0200
@@ -1,3 +1,14 @@
+mdadm (3.2.5-1+1) unstable; urgency=low
+
+  * also install mdmon in udeb and initramfs, so imsm arrays work
+  * mdmon now automatically makes a symlink in /run/sendsigs.omit.d to its pidfile
+  * create /run/sendsigs.omit.d/ in local-top script
+  * add script mdadm-waitidle that runs just before reboot/halt. For all
+    arrays that are still running, it sets safe_mode_delay to a low version,
+    sets sync_action to idle, and waits for the array(s) to go idle.
+
+ -- Miquel van Smoorenburg <miqu...@debian.org>  Mon, 06 Aug 2012 23:29:32 +0200
+
 mdadm (3.2.5-1) unstable; urgency=low
 
   [ Michael Tokarev ]
diff -ruN orig/mdadm-3.2.5/debian/initramfs/hook mdadm-3.2.5/debian/initramfs/hook
--- orig/mdadm-3.2.5/debian/initramfs/hook	2012-05-25 19:31:37.000000000 +0200
+++ mdadm-3.2.5/debian/initramfs/hook	2012-08-02 00:32:50.925671675 +0200
@@ -49,6 +49,7 @@
 }
 
 MDADM=/sbin/mdadm
+MDMON=/sbin/mdmon
 [ -x "$MDADM" ] || exit 0
 
 [ -r /usr/share/initramfs-tools/hook-functions ] || exit 0
@@ -56,6 +57,7 @@
 
 # copy the binary as early as possible
 copy_exec $MDADM /sbin
+copy_exec $MDMON /sbin
 
 # copy all modules into the initramfs, just for safety.
 # we copy raid456 / raid5+raid6 because the hook script just won't do
diff -ruN orig/mdadm-3.2.5/debian/initramfs/script.local-top mdadm-3.2.5/debian/initramfs/script.local-top
--- orig/mdadm-3.2.5/debian/initramfs/script.local-top	2012-05-10 22:22:16.000000000 +0200
+++ mdadm-3.2.5/debian/initramfs/script.local-top	2012-08-06 17:32:30.162720885 +0200
@@ -53,6 +53,9 @@
 # handle /dev/md/X nodes
 mkdir -p /dev/md
 
+# mdmon wants this directory to exist
+mkdir -p /run/sendsigs.omit.d
+
 CONFIG=/etc/mdadm/mdadm.conf
 # in case the hook failed to install a configuration file, this is our last
 # attempt... the "emergency procedure"... <drumroll>
diff -ruN orig/mdadm-3.2.5/debian/mdadm-waitidle mdadm-3.2.5/debian/mdadm-waitidle
--- orig/mdadm-3.2.5/debian/mdadm-waitidle	1970-01-01 01:00:00.000000000 +0100
+++ mdadm-3.2.5/debian/mdadm-waitidle	2012-08-06 23:49:22.138176669 +0200
@@ -0,0 +1,76 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          mdadm-waitidle
+# Required-Start:
+# Required-Stop:
+# Should-Stop:       halt reboot kexec
+# X-Stop-After:      umountroot
+# Default-Start:
+# Default-Stop:      0 6
+# Short-Description: Wait for MD arrays to become idle
+# Description:       This script waits until all MD arrays are
+#                    in idle and synced state before halt/reboot.
+### END INIT INFO
+#
+set -eu
+
+. /lib/lsb/init-functions
+
+case "${1:-}" in
+  start)
+    ;;
+  stop)
+    cd /sys/block
+    for md in md*
+    do
+      if [ -d "$md/md/" ]
+      then
+        if [ -w $md/md/safe_mode_delay ]; then
+          echo 0.05 > $md/md/safe_mode_delay ||:
+        fi
+        if [ -w $md/md/sync_action ]; then
+          echo idle > $md/md/sync_action ||:
+        fi
+        array_found=1
+      fi
+    done
+    [ -z "$array_found" ] && exit 0
+
+    log_action_begin_msg "Waiting for MD arrays to become idle"
+    sync
+    start=`date +%s`
+    secs=0
+    while [ $secs -lt 10 ]
+    do
+      secs=$((`date +%s` - $start))
+      active=
+      for md in md*
+      do
+        # We wait for normal writes, but not too long for resyncs/rebuilds.
+        state="`cat $md/md/array_state 2>/dev/null || echo unknown`"
+        sync="`cat $md/md/sync_action 2>/dev/null || echo idle`"
+        if [ "$state" = active ] && ([ "$sync" = idle ] || [ $secs -lt 3 ])
+        then
+          active=1
+        fi
+      done
+      [ -n "$active" ] || break
+      sleep 0.2
+    done
+
+    if [ -n "$active" ]
+    then
+      log_action_end_msg 1
+      sleep 1
+    else
+      log_action_end_msg 0
+    fi
+    ;;
+
+  *)
+    echo "Usage: ${0:-} {stop}" >&2
+    exit 1;;
+
+esac
+
+exit 0
diff -ruN orig/mdadm-3.2.5/debian/patches/debian-sendsigs-omit.patch mdadm-3.2.5/debian/patches/debian-sendsigs-omit.patch
--- orig/mdadm-3.2.5/debian/patches/debian-sendsigs-omit.patch	1970-01-01 01:00:00.000000000 +0100
+++ mdadm-3.2.5/debian/patches/debian-sendsigs-omit.patch	2012-08-06 16:59:45.205515235 +0200
@@ -0,0 +1,24 @@
+Index: mdadm-3.2.5/mdmon.c
+===================================================================
+--- mdadm-3.2.5.orig/mdmon.c	2012-05-18 07:10:03.000000000 +0000
++++ mdadm-3.2.5/mdmon.c	2012-08-06 14:59:28.881239759 +0000
+@@ -143,6 +143,7 @@
+ static int make_pidfile(char *devname)
+ {
+ 	char path[100];
++	char sendsigs_omit_path[100];
+ 	char pid[10];
+ 	int fd;
+ 	int n;
+@@ -160,6 +161,11 @@
+ 	close(fd);
+ 	if (n < 0)
+ 		return -errno;
++
++	/* debian: automatically symlink to sendsigs.omit.d/. ignore result. */
++	sprintf(sendsigs_omit_path, "/run/sendsigs.omit.d/%s.pid", devname);
++	symlink(path, sendsigs_omit_path);
++
+ 	return 0;
+ }
+ 
diff -ruN orig/mdadm-3.2.5/debian/patches/series mdadm-3.2.5/debian/patches/series
--- orig/mdadm-3.2.5/debian/patches/series	2012-05-25 18:49:06.000000000 +0200
+++ mdadm-3.2.5/debian/patches/series	2012-08-13 11:47:29.765991155 +0200
@@ -2,3 +2,4 @@
 debian-disable-udev-incr-assembly.diff
 debian-no-Werror.diff
 sha1-includes.diff
+debian-sendsigs-omit.patch
diff -ruN orig/mdadm-3.2.5/debian/rules mdadm-3.2.5/debian/rules
--- orig/mdadm-3.2.5/debian/rules	2012-05-25 19:31:37.000000000 +0200
+++ mdadm-3.2.5/debian/rules	2012-08-06 23:26:11.195263083 +0200
@@ -35,7 +35,8 @@
 	dh_testdir
 	$(MAKE) $(FLAGS) all
 	mv mdadm mdadm.udeb
-.PHONY: mdadm.udeb
+	mv mdmon mdmon.udeb
+.PHONY: mdadm.udeb mdmon.udeb
 
 mdadm: FLAGS = CXFLAGS="$(CXFLAGS)" CONFFILE=/etc/mdadm/mdadm.conf CONFFILE2=/etc/mdadm.conf
 mdadm: configure
@@ -50,7 +51,7 @@
 	rm -f $(INTERPOLATED_FILES)
 	rm -f build-stamp
 	[ ! -f Makefile ] || $(MAKE) clean
-	rm -f mdadm.udeb mdadm debian/mdadm-startall.8
+	rm -f mdadm.udeb mdmon.udeb mdadm debian/mdadm-startall.8
 	dh_clean
 	debconf-updatepo
 
@@ -80,6 +81,7 @@
 	install -m0755 debian/mdadm-startall $(DESTDIR)/sbin
 
 	install -m0755 mdadm.udeb $(DESTDIR_UDEB)/sbin/mdadm
+	install -m0755 mdmon.udeb $(DESTDIR_UDEB)/sbin/mdmon
 	install -m0644 udev-md-raid.rules $(DESTDIR_UDEB)/lib/udev/rules.d/64-md-raid.rules
 
 binary-indep: build install
@@ -92,6 +94,7 @@
 	dh_installdocs
 	dh_installexamples debian/mdadd.sh
 	dh_installinit --init-script=mdadm-raid --no-start -- start 25 S . start 60 0 6 .
+	dh_installinit --init-script=mdadm-waitidle --no-start -- stop 98 0 6 .
 	dh_installinit -- defaults 25
 	dh_installman
 	dh_installcron

--- End Message ---
--- Begin Message ---
Source: mdadm
Source-Version: 3.2.5-4+mdmon

We believe that the bug you reported is fixed in the latest version of
mdadm, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 684...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Tokarev <m...@tls.msk.ru> (supplier of updated mdadm package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 20 Oct 2012 19:20:12 +0400
Source: mdadm
Binary: mdadm mdadm-udeb
Architecture: source i386
Version: 3.2.5-4+mdmon
Distribution: experimental
Urgency: low
Maintainer: Debian mdadm maintainers <pkg-mdadm-de...@lists.alioth.debian.org>
Changed-By: Michael Tokarev <m...@tls.msk.ru>
Description: 
 mdadm      - tool to administer Linux MD arrays (software RAID)
 mdadm-udeb - tool to administer Linux MD arrays (software RAID) (udeb)
Closes: 684708 686100 686703 691668 691670 691671
Changes: 
 mdadm (3.2.5-4+mdmon) experimental; urgency=low
 .
   * fix `/etc/init.d/mdadm-raid status' inverse logic (Closes: #686100)
   * /etc/init.d/mdadm: change RUNDIR to /run instead of /var/run.
     Mdadm itself uses /run internally, we properly depend on initscripts
     version which creates /run, and the initscript itself is started
     after local_fs is processed, so this is merely a no-op, but let's
     do it for consistency.
   * Fix 'enough' function for RAID10, to prevent starting of a RAID10
     array which does not have required minimum of component devices.
     (Closes: #691668).
   * fix segfaults in Detail() - mdadm --detail may segfault if a drive
     has been removed from the array (Closes: #691670)
   * super0: do not override uuid with homehost.  The bug prevented
     re-creating an array with v0.90 superblock with the specified uuid
     when homehost is also specified.  (Closes: #686703)
   * several fixes for mdmon argument processing (Closes: #691671):
     - allow --takeover when original was started with --offroot
     - fix arg parsing.
     - fix arg processing for -a
   * Changes based on a patch by Miquel van Smoorenburg (Closes: #684708):
     - install mdmon in udeb and initramfs, so imsm arrays can work.
       mdadm runs mdmon automatically when needed (currently for imsm
       arrays), and mdmon is required to make such arrays read-write
       (they're read-only by default) so merely presence of mdmon is
       enough to be able to use imsm arrays.
     - /etc/init.d/mdadm start: if a mdmon pidfile is found in /run/mdadm,
       restart mdmon (--takeover --all)
     - /etc/init.d/mdadm stop: link pidfiles of mdmon processes into
       /run/sendsigs.omit.d, and make sure that happens before sendsigs runs.
     - stop mdadm before sendsigs, so that the above code works
     - add script mdadm-waitidle that runs just before reboot/halt.
       For each array that is still running, it sets sync_action to idle,
       and uses mdadm --wait-clean to wait for all arrays to go idle
       (it has a short timeout).
Checksums-Sha1: 
 027c92cc31020cab097bd84a5f156ffb4fa7508f 1515 mdadm_3.2.5-4+mdmon.dsc
 10e9e0437d895b462c3ce793873bb32455393ba3 127483 
mdadm_3.2.5-4+mdmon.debian.tar.bz2
 b67034f130aa1007088ff78940dad09743024b37 565840 mdadm_3.2.5-4+mdmon_i386.deb
 6874df31b5ed4ed67bd076509819076aaddd82c2 196250 
mdadm-udeb_3.2.5-4+mdmon_i386.udeb
Checksums-Sha256: 
 416ff0990bbe2f76f9eb6cc37cf0264aaf1771a82b4dc13a5592964ca5f92e73 1515 
mdadm_3.2.5-4+mdmon.dsc
 099b3f816db45c46ca0ae267c9b81549e1e1bc2023d7bff04279b867cfa3f7f9 127483 
mdadm_3.2.5-4+mdmon.debian.tar.bz2
 e075e22c5d232932f6811af27d4c2011cb29eca7bafd84ab7294df75cff9e8cf 565840 
mdadm_3.2.5-4+mdmon_i386.deb
 62742a3bb2d649d1de5bef817092632dbda35016d48a8afa8049239d121dfbcc 196250 
mdadm-udeb_3.2.5-4+mdmon_i386.udeb
Files: 
 91a614a28b83b127ba9e4539e21cf0d4 1515 admin optional mdadm_3.2.5-4+mdmon.dsc
 4ba1ed5148c8edf9b2b62fe3dae534e4 127483 admin optional 
mdadm_3.2.5-4+mdmon.debian.tar.bz2
 e0b1ec4744e126416b18efe2c4e10706 565840 admin optional 
mdadm_3.2.5-4+mdmon_i386.deb
 56f51cd65bff7e3fcbfc6e30d6f14b0b 196250 debian-installer optional 
mdadm-udeb_3.2.5-4+mdmon_i386.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iJwEAQECAAYFAlCNe/4ACgkQUlPFrXTwyDhXEwP9FY68VaxgwftKj8pWUjUUZONm
OpRmb95okOXfRt5KebXMV72lTUcE/WwHxlN5rZ6ZMFKRfvzobZ55DPDotCdr+262
Jg4666D81s377S+PZdYkccceXr9DPs4wW4hiXrBiKQ5lBkfowUTchzGKfYb470DO
SeaTk7iyl1dBH7XZ3uM=
=2IZ7
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to