diff options
author | Bart Brouns <bart@magnetopon.nl> | 2015-05-25 17:40:16 +0200 |
---|---|---|
committer | Bart Brouns <bart@magnetopon.nl> | 2015-05-26 15:13:59 +0200 |
commit | c3b7a8b053bc08c82dd8a312fda769110b3ab578 (patch) | |
tree | 0824e1e4338f6e5df4b2271b1ed7bbb8ef33b290 /nixos | |
parent | f2f635b1f58d88a40377092b72c70d3997cd9dfd (diff) | |
download | nixpkgs-c3b7a8b053bc08c82dd8a312fda769110b3ab578.tar nixpkgs-c3b7a8b053bc08c82dd8a312fda769110b3ab578.tar.gz nixpkgs-c3b7a8b053bc08c82dd8a312fda769110b3ab578.tar.bz2 nixpkgs-c3b7a8b053bc08c82dd8a312fda769110b3ab578.tar.lz nixpkgs-c3b7a8b053bc08c82dd8a312fda769110b3ab578.tar.xz nixpkgs-c3b7a8b053bc08c82dd8a312fda769110b3ab578.tar.zst nixpkgs-c3b7a8b053bc08c82dd8a312fda769110b3ab578.zip |
add das_watchdog: a realtime watchdog
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/das_watchdog.nix | 34 |
2 files changed, 35 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index cd679f8e93c..9a5aaf108ec 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -222,6 +222,7 @@ ./services/monitoring/bosun.nix ./services/monitoring/cadvisor.nix ./services/monitoring/collectd.nix + ./services/monitoring/das_watchdog.nix ./services/monitoring/dd-agent.nix ./services/monitoring/graphite.nix ./services/monitoring/monit.nix diff --git a/nixos/modules/services/monitoring/das_watchdog.nix b/nixos/modules/services/monitoring/das_watchdog.nix new file mode 100644 index 00000000000..785b4289dff --- /dev/null +++ b/nixos/modules/services/monitoring/das_watchdog.nix @@ -0,0 +1,34 @@ +# A general watchdog for the linux operating system that should run in the +# background at all times to ensure a realtime process won't hang the machine +{ config, lib, pkgs, ... }: + +with lib; + +let + + inherit (pkgs) das_watchdog; + +in { + ###### interface + + options = { + services.das_watchdog.enable = mkEnableOption "Whether to enable realtime watchdog"; + }; + + ###### implementation + + config = mkIf config.services.das_watchdog.enable { + environment.systemPackages = [ das_watchdog ]; + systemd.services.das_watchdog = { + description = "Watchdog to ensure a realtime process won't hang the machine"; + after = [ "multi-user.target" "sound.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + User = "root"; + Type = "oneshot"; + ExecStart = "${das_watchdog}/bin/das_watchdog"; + RemainAfterExit = true; + }; + }; + }; +} |