From b3da3cb0a4522434e7cefcdf2d507ddbd1748500 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 8 Aug 2012 15:02:42 +0200 Subject: [PATCH] saving uncommitted changes in /etc prior to emerge run --- init.d/mdraid | 54 +++++++++++++++++++++++++-------------------------- mdadm.conf | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/init.d/mdraid b/init.d/mdraid index 1a566cf..27421e2 100755 --- a/init.d/mdraid +++ b/init.d/mdraid @@ -1,40 +1,40 @@ #!/sbin/runscript -# Copyright 1999-2007 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/files/mdraid.rc-3.1.1,v 1.1 2010/01/24 22:20:57 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/files/mdraid.rc,v 1.6 2011/11/12 21:06:44 vapier Exp $ depend() { - if [ ! -e /sbin/functions.sh ] ; then - # on baselayout-1 this could cause - # dependency-cycles with checkroot (before *) - before checkfs fsck - after modules - fi -} - -run_addon() { - local f=/lib64/rcscripts/addons/$1.sh - if [ -r "$f" ]; then - ( . "$f" ) - fi -} -start_addon() { - run_addon "$1"-start -} -stop_addon() { - run_addon "$1"-stop + before checkfs fsck + after modules } start() { - if [ -e /sbin/functions.sh ] ; then - eerror "The ${SVCNAME} init script is written for baselayout-2" - eerror "Please do not use it with baselayout-1" - return 1 + local output + + ebegin "Starting up RAID devices" + output=$(mdadm -As 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 - start_addon raid + return 0 } stop() { - stop_addon raid + 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}" } diff --git a/mdadm.conf b/mdadm.conf index 7bdff67..d9d8d39 100644 --- a/mdadm.conf +++ b/mdadm.conf @@ -59,7 +59,7 @@ # When used in --follow (aka --monitor) mode, mdadm needs a # mail address and/or a program. This can be given with "mailaddr" # and "program" lines to that monitoring can be started using -# mdadm --follow --scan & echo $! > /var/run/mdadm +# mdadm --follow --scan & echo $! > /run/mdadm/mon.pid # If the lines are not found, mdadm will exit quietly #MAILADDR root@mydomain.tld #PROGRAM /usr/sbin/handle-mdadm-events -- 2.39.5