summaryrefslogtreecommitdiff
path: root/debian/mdadm-raid
diff options
context:
space:
mode:
authorMichael Tokarev <mjt@tls.msk.ru>2011-09-10 13:26:17 +0400
committerMichael Tokarev <mjt@tls.msk.ru>2011-09-10 13:27:56 +0400
commitd98f009ef8866481ad7c848b6b9dcc973c578a7b (patch)
tree2f3f2710c5ecdf8a208debbe47b7ff9f52b29fb4 /debian/mdadm-raid
parentc5ec06b32e22a97ceec0dbd7400a3ea988431739 (diff)
move initscript metadata from /lib/init/rw/.mdadm to /run/mdadm
Debian-Bug: 633054
Diffstat (limited to 'debian/mdadm-raid')
-rw-r--r--debian/mdadm-raid17
1 files changed, 5 insertions, 12 deletions
diff --git a/debian/mdadm-raid b/debian/mdadm-raid
index e85ec095..b53a5a81 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"