From f61f0c139b85766cff6bd40c304cdbf957ea2b27 Mon Sep 17 00:00:00 2001 From: Mathijs Kwik Date: Thu, 27 Dec 2012 09:50:40 +0100 Subject: [PATCH] systemd: convert smartd job to service --- modules/services/monitoring/smartd.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/services/monitoring/smartd.nix b/modules/services/monitoring/smartd.nix index 7e57f90398b..72a4495b1f5 100644 --- a/modules/services/monitoring/smartd.nix +++ b/modules/services/monitoring/smartd.nix @@ -57,7 +57,7 @@ in description = '' Additional options for each device that is monitored. The example turns on SMART Automatic Offline Testing on startup, and schedules short - self-tests daily, and long self-tests weekly. + self-tests daily, and long self-tests weekly. ''; }; @@ -81,18 +81,16 @@ in config = mkIf cfg.enable { - jobs.smartd = { - description = "S.M.A.R.T. Daemon"; + boot.systemd.services.smartd = { + description = "S.M.A.R.T. Daemon"; - environment.TZ = config.time.timeZone; + environment.TZ = config.time.timeZone; - wantedBy = [ "multi-user.target" ]; - partOf = [ "multi-user.target" ]; + wantedBy = [ "multi-user.target" ]; + partOf = [ "multi-user.target" ]; - path = [ pkgs.smartmontools ]; - - exec = "smartd --no-fork --pidfile=/var/run/smartd.pid ${smartdFlags}"; - }; + serviceConfig.ExecStart = "${pkgs.smartmontools}/sbin/smartd --no-fork ${smartdFlags}"; + }; };