core updated.

This commit is contained in:
Ertuğrul Erata
2015-05-17 16:28:10 +03:00
parent 14d58aa1d0
commit 8e13c775be
558 changed files with 543408 additions and 27657 deletions
+7
View File
@@ -0,0 +1,7 @@
# config file for mdadm
# Misc options to pass to mdadm in monitor mode.
# For more info, run `mdadm --monitor --help` or see
# the mdadm(8) manpage.
MDADM_OPTS="--syslog"
+8
View File
@@ -0,0 +1,8 @@
# This file causes block devices with Linux RAID (mdadm) signatures to
# automatically cause mdadm to be run.
# See udev(8) for syntax
SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="linux_raid_member", \
IMPORT{program}="/sbin/mdadm --examine --export $tempnode", \
RUN+="/bin/bash -c '[ ! -f /dev/.in_sysinit ] && mdadm -I $env{DEVNAME}'"
+8
View File
@@ -0,0 +1,8 @@
[Unit]
Description=MDADM Event Monitor
[Service]
ExecStart=/sbin/mdadm --monitor --scan
[Install]
WantedBy=multi-user.target
@@ -0,0 +1 @@
d /run/mdadm 0710 root root -
@@ -0,0 +1,6 @@
#!/bin/bash
for dev in `grep "^md.*: active" /proc/mdstat | cut -f 1 -d ' '`; do
echo "repair" > /sys/block/$dev/md/sync_action
done
@@ -0,0 +1,29 @@
[[ -f /proc/mdstat ]] || exit 0
# Try to make sure the devices exist before we use them
create_devs() {
local node dir minor
for node in $@ ; do
[[ ${node} != /dev/* ]] && node=/dev/${node}
[[ -e ${node} ]] && continue
dir=${node%/*}
[[ ! -d ${dir} ]] && mkdir -p "${dir}"
minor=${node##*/}
mknod "${node}" b ${MAJOR} ${minor##*md} &> /dev/null
done
}
[[ -e /etc/mdadm.conf ]] && mdadm_conf="/etc/mdadm.conf"
if [[ -x /sbin/mdadm && -f ${mdadm_conf} ]] ; then
devs=$(awk '/^[[:space:]]*ARRAY/ { print $2 }' ${mdadm_conf})
if [[ -n ${devs} ]] ; then
create_devs ${devs}
ebegin "Starting up RAID devices (mdadm)"
output=$(mdadm -As 2>&1)
ret=$?
[[ ${ret} -ne 0 ]] && echo "${output}"
eend ${ret}
fi
fi
@@ -0,0 +1,10 @@
[[ -f /proc/mdstat ]] || exit 0
[[ -e /etc/mdadm.conf ]] && mdadm_conf="/etc/mdadm.conf"
if [[ -x /sbin/mdadm && -f ${mdadm_conf} ]] ; then
ebegin "Shutting down RAID devices (mdadm)"
output=$(mdadm -Ss 2>&1)
ret=$?
[[ ${ret} -ne 0 ]] && echo "${output}"
eend ${ret}
fi