Forráskód Böngészése

feat(odin+hd-idle): added fatrace to log what wakes up the drives

Zander Hawke 9 hónapja
szülő
commit
188436b482
1 módosított fájl, 13 hozzáadás és 1 törlés
  1. 13 1
      hosts/odin/system/hd-idle.nix

+ 13 - 1
hosts/odin/system/hd-idle.nix

@@ -12,7 +12,7 @@ let
   args = mkArgString disks;
 in
 {
-  environment.systemPackages = [ pkgs.hd-idle ];
+  environment.systemPackages = [ pkgs.hd-idle pkgs.fatrace ];
 
   systemd.services.hd-idle = {
     description = "hd-idle - spin down idle hard disks";
@@ -30,4 +30,16 @@ in
       Restart = "always";
     };
   };
+
+  systemd.services.fatrace = {
+    description = "File access tracing service";
+    after = [ "local-fs.target" ];
+    wants = [ "local-fs.target" ];
+
+    serviceConfig = {
+      ExecStart = "${lib.getExe pkgs.fatrace} --timestamp /mnt/storage";
+      Restart = "always";
+      User = "root";
+    };
+  };
 }