aboutsummaryrefslogtreecommitdiffstats
path: root/main/mdadm/mdadm-raid.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-07-23 18:24:11 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-07-23 18:24:11 +0000
commit2d2ddf507bf1ae2f4cc595b23b8e018398cbe8dd (patch)
treea63d3b3b1c89018b5419358eed5c2bb0acf1cd92 /main/mdadm/mdadm-raid.initd
parente374901731eb35599bd6735de4dd38560e3a79b8 (diff)
downloadaports-2d2ddf507bf1ae2f4cc595b23b8e018398cbe8dd.tar.bz2
aports-2d2ddf507bf1ae2f4cc595b23b8e018398cbe8dd.tar.xz
move core/* to main/
added maintainer to several packages as well
Diffstat (limited to 'main/mdadm/mdadm-raid.initd')
-rw-r--r--main/mdadm/mdadm-raid.initd19
1 files changed, 19 insertions, 0 deletions
diff --git a/main/mdadm/mdadm-raid.initd b/main/mdadm/mdadm-raid.initd
new file mode 100644
index 0000000000..ea84088886
--- /dev/null
+++ b/main/mdadm/mdadm-raid.initd
@@ -0,0 +1,19 @@
+#!/sbin/runscript
+
+# script to start raid devices described in /etc/mdadm.conf.
+
+start() {
+ [ -f /proc/mdstat ] || modprobe -k md > /dev/null 2>&1
+ ebegin "Starting RAID devices"
+ mdadm -A -s -q
+ eend $?
+}
+
+stop() {
+ # you need to make sure no device is mounted.
+ if [ -f /etc/mdadm.conf ] ; then
+ ebegin "Stopping RAID devices"
+ mdadm --stop -q `awk '/^ARRAY/ { print $2 }' /etc/mdadm.conf`
+ eend $?
+ fi
+}