60 lines
1.2 KiB
Plaintext
60 lines
1.2 KiB
Plaintext
|
#! /bin/sh
|
||
|
#
|
||
|
# Copyright (c) 2007 SuSE GmbH Nuernberg, Germany. All rights reserved.
|
||
|
#
|
||
|
# /etc/init.d/boot.dmraid
|
||
|
#
|
||
|
### BEGIN INIT INFO
|
||
|
# Provides: boot.dmraid
|
||
|
# Required-Start: boot.device-mapper boot.udev boot.rootfsck
|
||
|
# Should-Start: boot.multipath boot.md boot.scsidev
|
||
|
# Default-Start: B
|
||
|
# Default-Stop:
|
||
|
# Description: start dmraid
|
||
|
### END INIT INFO
|
||
|
|
||
|
. /etc/rc.status
|
||
|
. /etc/sysconfig/dmraid
|
||
|
|
||
|
DMRAID=/sbin/dmraid
|
||
|
test -x $DMRAID || { echo "dmraid not installed";
|
||
|
if [ "$1" = "stop" ]; then exit 0;
|
||
|
else exit 5; fi; }
|
||
|
|
||
|
# udev interaction
|
||
|
if [ -x /sbin/udevsettle ]; then
|
||
|
[ -z "$DMRAID_DEVICE_TIMEOUT" ] && DMRAID_DEVICE_TIMEOUT=60
|
||
|
else
|
||
|
DMRAID_DEVICE_TIMEOUT=0
|
||
|
fi
|
||
|
|
||
|
rc_reset
|
||
|
|
||
|
case "$1" in
|
||
|
start)
|
||
|
# Waiting for udev to settle
|
||
|
if [ "$DMRAID_DEVICE_TIMEOUT" -gt 0 ] ; then
|
||
|
echo "Waiting for udev to settle..."
|
||
|
/sbin/udevsettle --timeout=$DMRAID_DEVICE_TIMEOUT
|
||
|
fi
|
||
|
echo "Activating dmraid..."
|
||
|
$DMRAID -ay $DMRAID_START_OPTIONS
|
||
|
|
||
|
rc_status -v -r
|
||
|
;;
|
||
|
stop)
|
||
|
$DMRAID -an $DMRAID_STOP_OPTIONS
|
||
|
rc_status -v
|
||
|
;;
|
||
|
status)
|
||
|
rc_failed 4
|
||
|
rc_status -v
|
||
|
;;
|
||
|
*)
|
||
|
echo "Usage: $0 {start|stop|status}"
|
||
|
exit 1
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
rc_exit
|