diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-fs/mdadm/files/mdraid.rc |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/mdadm/files/mdraid.rc')
-rw-r--r-- | sys-fs/mdadm/files/mdraid.rc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sys-fs/mdadm/files/mdraid.rc b/sys-fs/mdadm/files/mdraid.rc new file mode 100644 index 000000000000..a30035dbbba2 --- /dev/null +++ b/sys-fs/mdadm/files/mdraid.rc @@ -0,0 +1,39 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + before checkfs fsck + after modules +} + +start() { + local output + + ebegin "Starting up RAID devices" + output=$(mdadm -As ${MDADM_ASSEMBLE_OPTS} 2>&1) + eend $? "${output}" + + local pat="/dev/md_d*" + set -- ${pat} + if [ "$*" != "${pat}" ] ; then + ebegin "Creating RAID device partitions" + blockdev "$@" + eend $? + # wait because vgscan runs next, and we want udev to fire + sleep 1 + fi + + return 0 +} + +stop() { + local output + + # XXX: Maybe drop this check ? + [ ! -e /etc/mdadm/mdadm.conf ] && [ ! -e /etc/mdadm.conf ] && return 0 + + ebegin "Shutting down RAID devices (mdadm)" + output=$(mdadm -Ss 2>&1) + eend $? "${output}" +} |