[Nix-dev] Re: [Nix-commits] SVN commit: nix - 19148 - sandervanderburg - nixos/trunk/modules/tasks

Nicolas Pierron nicolas.b.pierron at gmail.com
Wed Dec 30 11:31:57 CET 2009


On Tue, Dec 29, 2009 at 22:23, Sander van der Burg
<S.vanderBurg at tudelft.nl> wrote:
> Log:
> Made a small fix because I kept receiving errors about: diff command not found. It also makes my system horribly slow.

I don't think this has made your system slow because the series of
patch made recently on this file was done to remove an infinite loop
of "initctl emit -n new-devices" and to assemble new arrays when one
is reported by mdadm.  This slow down is cannot be caused by one
execution of diff on almost empty files.

The loop of "new-devices" flags had the bad consequence to mount every
file systems again and again.

> Changes:
>
> Modified: nixos/trunk/modules/tasks/swraid.nix
> ===================================================================
> --- nixos/trunk/modules/tasks/swraid.nix        2009-12-29 19:28:44 UTC (rev 19147)
> +++ nixos/trunk/modules/tasks/swraid.nix        2009-12-29 21:23:22 UTC (rev 19148)
> @@ -7,7 +7,7 @@
>   tempConf = "/var/run/mdadm.conf";
>   logFile = "/var/log/mdadmEvents.log";
>   modprobe = config.system.sbin.modprobe;
> -  inherit (pkgs) mdadm;
> +  inherit (pkgs) mdadm diffutils;
>
>   mdadmEventHandler = pkgs.writeScript "mdadmEventHandler.sh" ''
>     #!/bin/sh
> @@ -42,7 +42,7 @@
>       # Scan /proc/partitions for RAID devices.
>       ${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.
>         ${mdadm}/sbin/mdadm --assemble -c ${tempConf} --scan
>



-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/
Donald Knuth - I can't go to a restaurant because I keep looking at
the fonts on the menu.



More information about the nix-dev mailing list