[Nix-dev] Re: [Nix-commits] SVN commit: nix - 18401 - raskin - nixos/trunk/modules/services/monitoring

Nicolas Pierron nicolas.b.pierron at gmail.com
Wed Nov 18 11:51:11 CET 2009


Hi list,

On Wed, Nov 18, 2009 at 10:29, Michael Raskin <7c6f434c at mail.ru> wrote:
> Modified: nixos/trunk/modules/services/monitoring/monit.nix
> ===================================================================
> --- nixos/trunk/modules/services/monitoring/monit.nix   2009-11-18 08:40:32 UTC (rev 18400)
> +++ nixos/trunk/modules/services/monitoring/monit.nix   2009-11-18 09:29:43 UTC (rev 18401)
> @@ -37,7 +37,7 @@
>         mode = "0400";
>       }
>     ];
> -    jobs.monit = {
> +    jobs.monit = mkIf config.services.monit.enable {
>       description = "Monit system watcher";
>
>       startOn = config.services.monit.startOn;
>

This is just a general warning on such thing.  The "jobs" attribute
represents an option (cf manual), thus the mkIf statement is declared
inside the "jobs" option.  When monit is not enable such case would
cause the following result:

jobs.monit = {};

This may create an upstart event for monit with nothing in it.  So I
recommend you to write:

jobs = mkIf ...enable {
  monit = { ... };
};

This is a known issue and I'll have to work on it.

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/
Lars Rasmussen (Google IO 2009) - Icland is an icland.



More information about the nix-dev mailing list