Made a small fix because I kept receiving errors about: diff command not found. It also makes my system horribly slow.
svn path=/nixos/trunk/; revision=19148
This commit is contained in:
parent
4cf78fdb77
commit
df21f0f06d
@ -7,7 +7,7 @@ let
|
|||||||
tempConf = "/var/run/mdadm.conf";
|
tempConf = "/var/run/mdadm.conf";
|
||||||
logFile = "/var/log/mdadmEvents.log";
|
logFile = "/var/log/mdadmEvents.log";
|
||||||
modprobe = config.system.sbin.modprobe;
|
modprobe = config.system.sbin.modprobe;
|
||||||
inherit (pkgs) mdadm;
|
inherit (pkgs) mdadm diffutils;
|
||||||
|
|
||||||
mdadmEventHandler = pkgs.writeScript "mdadmEventHandler.sh" ''
|
mdadmEventHandler = pkgs.writeScript "mdadmEventHandler.sh" ''
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
@ -42,7 +42,7 @@ in
|
|||||||
# Scan /proc/partitions for RAID devices.
|
# Scan /proc/partitions for RAID devices.
|
||||||
${mdadm}/sbin/mdadm --examine --brief --scan -c partitions > ${tempConf}
|
${mdadm}/sbin/mdadm --examine --brief --scan -c partitions > ${tempConf}
|
||||||
|
|
||||||
if ! diff ${tempConf} ${tempConf}.old > /dev/null; then
|
if ! ${diffutils}/bin/diff ${tempConf} ${tempConf}.old > /dev/null; then
|
||||||
# Activate each device found.
|
# Activate each device found.
|
||||||
${mdadm}/sbin/mdadm --assemble -c ${tempConf} --scan
|
${mdadm}/sbin/mdadm --assemble -c ${tempConf} --scan
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user