diff options
author | Arseniy Seroka <jagajaga@users.noreply.github.com> | 2015-05-27 11:47:15 +0300 |
---|---|---|
committer | Arseniy Seroka <jagajaga@users.noreply.github.com> | 2015-05-27 11:47:15 +0300 |
commit | 43690ae4eeb763344e99313a52ca8abe50e1575b (patch) | |
tree | 6d3b2129b08f93d0e1cf1e67e42128216b90dbd9 /nixos | |
parent | 4e4d01af81f627fe7ea3221ccd0e2d9a7f4b94e6 (diff) | |
parent | c3b7a8b053bc08c82dd8a312fda769110b3ab578 (diff) | |
download | nixpkgs-43690ae4eeb763344e99313a52ca8abe50e1575b.tar nixpkgs-43690ae4eeb763344e99313a52ca8abe50e1575b.tar.gz nixpkgs-43690ae4eeb763344e99313a52ca8abe50e1575b.tar.bz2 nixpkgs-43690ae4eeb763344e99313a52ca8abe50e1575b.tar.lz nixpkgs-43690ae4eeb763344e99313a52ca8abe50e1575b.tar.xz nixpkgs-43690ae4eeb763344e99313a52ca8abe50e1575b.tar.zst nixpkgs-43690ae4eeb763344e99313a52ca8abe50e1575b.zip |
Merge pull request #7987 from magnetophon/das_watchdog-master
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 2870a259adb..25633bae169 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; + }; + }; + }; +} |