mdraid: add mdmon-offroot@.service and takeover mdmon in shutdown

master
Harald Hoyer 2013-01-18 11:01:43 +01:00
parent ebd1d65a1b
commit ffc4f173b6
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,16 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
_do_mdmon_takeover() {
local ret
mdmon --takeover --all
ret=$?
[ $ret -eq 0 ] && info "Taking over mdmon processes."
return $ret
}

if command -v mdmon >/dev/null; then
_do_mdmon_takeover $1
else
:
fi

View File

@ -88,5 +88,8 @@ install() {
inst_hook shutdown 30 "$moddir/md-shutdown.sh"
inst_script "$moddir/mdraid-cleanup.sh" /sbin/mdraid-cleanup
inst_script "$moddir/mdraid_start.sh" /sbin/mdraid_start
if [ -e /lib/systemd/system/mdmon-offroot@.service ]; then
inst_simple /lib/systemd/system/mdmon-offroot@.service
fi
inst_hook pre-shutdown 30 "$moddir/mdmon-pre-shutdown.sh"
}