diff options
author | madduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464> | 2006-10-26 21:39:20 +0000 |
---|---|---|
committer | madduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464> | 2006-10-26 21:39:20 +0000 |
commit | 25690fff481fad6e3686ed1e6e8cdec09f748072 (patch) | |
tree | c7837b8528e274df6c9bae8b5b2f110d4196b00f /debian | |
parent | 488e6bc8a934da39e7f7f657c83499677475e98c (diff) |
* Send udev events for arrays assembled by the mdadm-raid init.d script.
This does not close #394193 but it's a good addition anyway. I am not
sending these events from the initramfs as well because it would be
non-trivial to ensure that an event doesn't get sent twice for a given
array.
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | debian/mdadm-raid | 14 |
2 files changed, 19 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index 8070259f..2b152aa1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,11 +16,11 @@ mdadm (2.5.5-1) unstable; urgency=low * Now recommends module-init-tools. * Hides ugly errors during configuration in the absense of module-init-tools or initramfs-tools. - * Send udev events for all arrays assembled by the time the mdadm-raid - init.d script runs. This does not close #394193 but it's a good addition - anyway. I am not sending these events from the initramfs as well because - it would be non-trivial to ensure that an event doesn't get sent twice for - a given array. + * Send udev events for arrays assembled by the mdadm-raid init.d script. + This does not close #394193 but it's a good addition anyway. I am not + sending these events from the initramfs as well because it would be + non-trivial to ensure that an event doesn't get sent twice for a given + array. * Added more RAID10 information to the FAQ. * Added filters to logcheck for regular events, even by the md driver; also promoted messages about non-fresh components to security events. diff --git a/debian/mdadm-raid b/debian/mdadm-raid index 385db66d..ca76fcdc 100644 --- a/debian/mdadm-raid +++ b/debian/mdadm-raid @@ -81,6 +81,14 @@ is_true() esac } +STATEDIR=/dev +for dir in /lib/init/rw /dev/shm; do + test -d $dir/.mdadm && STATEDIR=$dir && break + test -w $dir || continue + STATEDIR=$dir +done +mkdir $STATEDIR/.mdadm 2>/dev/null && STATEDIR=$STATEDIR/.mdadm || unset STATEDIR + case "${1:-}" in start) PREFIX="Assembling MD array" @@ -161,8 +169,11 @@ case "${1:-}" in log_action_begin_msg "Generating udev events for MD arrays" for uevent in /sys/block/md*/uevent; do + array=${uevent#/sys/block/}; array=${dev%/uevent} + test -e $STATEDIR/$array && continue test -w $uevent || continue echo add > $uevent + : > $STATEDIR/$array done log_action_end_msg 0 @@ -220,6 +231,9 @@ case "${1:-}" in *) :;; esac done || exit $? + + rm -rf $STATEDIR + else log_notice "disabled in $DEBIANCONFIG" fi |