diff options
author | Carlo Lanmdeter <clandmeter@gmail> | 2009-02-20 10:42:26 +0000 |
---|---|---|
committer | Carlo Lanmdeter <clandmeter@gmail> | 2009-02-20 10:42:26 +0000 |
commit | 694d368979d59c8a8c294bb815d6519bc8e7f794 (patch) | |
tree | add8f971e78b3436a7516accf0889077def6405f /core/mdadm | |
parent | ea40cbb4b477fb76536a132f85c3eb0c97c4169d (diff) | |
download | aports-694d368979d59c8a8c294bb815d6519bc8e7f794.tar.bz2 aports-694d368979d59c8a8c294bb815d6519bc8e7f794.tar.xz |
core/mdadm: add init.d script to start raid on boot.
Diffstat (limited to 'core/mdadm')
-rw-r--r-- | core/mdadm/APKBUILD | 5 | ||||
-rw-r--r-- | core/mdadm/mdadm-raid.initd | 19 |
2 files changed, 23 insertions, 1 deletions
diff --git a/core/mdadm/APKBUILD b/core/mdadm/APKBUILD index f0a9f8926d..ae08dce76d 100644 --- a/core/mdadm/APKBUILD +++ b/core/mdadm/APKBUILD @@ -12,6 +12,7 @@ subpackages="$pkgname-doc" source="http://www.kernel.org/pub/linux/utils/raid/${pkgname}/${pkgname}-${pkgver}.tar.gz ${pkgname}.initd ${pkgname}.confd + mdadm-raid.initd " build() { @@ -21,10 +22,12 @@ build() { make INSTALL=/bin/install DESTDIR=$pkgdir install install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -m755 -D "$srcdir"/$pkgname-raid.initd "$pkgdir"/etc/init.d/$pkgname-raid install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname install -m644 -D mdadm.conf-example "$pkgdir"/etc/mdadm.conf } md5sums="bcc30968711a078387fba44867eb7a23 mdadm-2.6.8.tar.gz 96b323ba5b778aeb905c119b9547b2a5 mdadm.initd -16d2b8eb2e17184357db503470fdd8eb mdadm.confd" +16d2b8eb2e17184357db503470fdd8eb mdadm.confd +cf60ee08fc4fbed0450c5a2d4efc4214 mdadm-raid.initd" diff --git a/core/mdadm/mdadm-raid.initd b/core/mdadm/mdadm-raid.initd new file mode 100644 index 0000000000..ea84088886 --- /dev/null +++ b/core/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 +} |