Michael Tokarev: move initscript metadata from /lib/init/rw/.mdadm to /run/ mdadm
Michael Tokarev
mjt at alioth.debian.org
Sat Sep 10 10:56:36 UTC 2011
Module: mdadm
Branch: master
Commit: d98f009ef8866481ad7c848b6b9dcc973c578a7b
URL: http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=d98f009ef8866481ad7c848b6b9dcc973c578a7b
Author: Michael Tokarev <mjt at tls.msk.ru>
Date: Sat Sep 10 13:26:17 2011 +0400
move initscript metadata from /lib/init/rw/.mdadm to /run/mdadm
Debian-Bug: 633054
---
debian/changelog | 2 ++
debian/control | 2 +-
debian/mdadm-raid | 17 +++++------------
3 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index ad1df99..7221aa6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -24,6 +24,8 @@ mdadm (3.2.2-1) UNRELEASED; urgency=low
[ Michael Tokarev ]
* don't print W: auto-read-only in checkarray in quiet mode,
thanks to Bernd Hanisch for the patch (Closes: #605722)
+ * move initscript metadata from /lib/init/rw/.mdadm to /run/mdadm,
+ and depend on initscripts (>= 2.88dsf-13.3) for /run (Closes: #633054)
-- martin f. krafft <madduck at debian.org> Fri, 29 Jul 2011 15:47:31 +0200
diff --git a/debian/control b/debian/control
index 300e5c4..19828de 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,7 @@ Homepage: http://neil.brown.name/blog/mdadm
Package: mdadm
Architecture: any
-Depends: ${shlibs:Depends}, udev | makedev, ${misc:Depends}, lsb-base (>= 3.1-6), debconf (>= 1.4.72)
+Depends: ${shlibs:Depends}, udev | makedev, ${misc:Depends}, lsb-base (>= 3.1-6), debconf (>= 1.4.72), initscripts (>= 2.88dsf-13.3)
Recommends: default-mta | mail-transport-agent, module-init-tools
Replaces: mdctl
Conflicts: mdctl (<< 0.7.2), raidtools2 (<< 1.00.3-12.1), initramfs-tools (<< 0.65)
diff --git a/debian/mdadm-raid b/debian/mdadm-raid
index e85ec09..b53a5a8 100644
--- a/debian/mdadm-raid
+++ b/debian/mdadm-raid
@@ -32,6 +32,7 @@ DEBIANCONFIG=/etc/default/mdadm
test -x "$MDADM" || exit 0
AUTOSTART=true
+STATEDIR=/run/mdadm
test -f $DEBIANCONFIG && . $DEBIANCONFIG
. /lib/lsb/init-functions
@@ -81,15 +82,6 @@ is_true()
esac
}
-for dir in /lib/init/rw /dev/shm /dev; do
- statedir=$dir/.mdadm
- test -d $statedir && STATEDIR=$statedir && break
- test -w $dir || continue
- mkdir $statedir || continue
- STATEDIR=$statedir
- break
-done
-
case "${1:-}" in
start)
PREFIX="Assembling MD array"
@@ -173,13 +165,14 @@ case "${1:-}" in
ret=$?
log_action_begin_msg "Generating udev events for MD arrays"
+ [ -d $STATEDIR ] || mkdir -p $STATEDIR
for uevent in /sys/block/md*/uevent; do
test -e $uevent || break
sentinel=${uevent#/sys/block/}; sentinel=${sentinel%/uevent}-uevent
- test -e ${STATEDIR:-/doesnotexist}/$sentinel && continue
+ test -e $STATEDIR/$sentinel && continue
test -w $uevent || continue
echo add > $uevent
- test -d "${STATEDIR:-}" && : > $STATEDIR/$sentinel
+ test -d $STATEDIR && : > $STATEDIR/$sentinel
done
log_action_end_msg 0
@@ -238,7 +231,7 @@ case "${1:-}" in
esac
done || exit $?
- rm -rf ${STATEDIR:-}
+ rm -f $STATEDIR/md*-uevent
else
log_notice "disabled in $DEBIANCONFIG"
More information about the pkg-mdadm-commits
mailing list