summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRicardo M. Correia <rcorreia@wizy.org>2017-02-17 00:08:06 +0100
committerRobin Gloster <mail@glob.in>2017-02-20 22:35:51 +0100
commitd9ae88694695c21d599790c4fdebc3fa062ddaa1 (patch)
treeb12619d070200bd95f7fa102f6a3244d2bc13de3 /nixos
parentffcb272e01bd1abc595878e11378ef01a149137e (diff)
downloadnixlib-d9ae88694695c21d599790c4fdebc3fa062ddaa1.tar
nixlib-d9ae88694695c21d599790c4fdebc3fa062ddaa1.tar.gz
nixlib-d9ae88694695c21d599790c4fdebc3fa062ddaa1.tar.bz2
nixlib-d9ae88694695c21d599790c4fdebc3fa062ddaa1.tar.lz
nixlib-d9ae88694695c21d599790c4fdebc3fa062ddaa1.tar.xz
nixlib-d9ae88694695c21d599790c4fdebc3fa062ddaa1.tar.zst
nixlib-d9ae88694695c21d599790c4fdebc3fa062ddaa1.zip
nixos.openntpd: don't spam systemd journal
Starting `ntpd` with the `-d` option spams the systemd journal.
Instead, let the server fork.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/openntpd.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/openntpd.nix b/nixos/modules/services/networking/openntpd.nix
index 13a1b5258ce0..4bb9da54fe09 100644
--- a/nixos/modules/services/networking/openntpd.nix
+++ b/nixos/modules/services/networking/openntpd.nix
@@ -11,6 +11,9 @@ let
     ${concatStringsSep "\n" (map (s: "server ${s}") cfg.servers)}
     ${cfg.extraConfig}
   '';
+
+  pidFile = "/run/openntpd.pid";
+
 in
 {
   ###### interface
@@ -67,7 +70,11 @@ in
       wants = [ "network-online.target" "time-sync.target" ];
       before = [ "time-sync.target" ];
       after = [ "dnsmasq.service" "bind.service" "network-online.target" ];
-      serviceConfig.ExecStart = "${package}/sbin/ntpd -d -f ${cfgFile} ${cfg.extraOptions}";
+      serviceConfig = {
+        ExecStart = "${package}/sbin/ntpd -f ${cfgFile} -p ${pidFile} ${cfg.extraOptions}";
+        Type = "forking";
+        PIDFile = pidFile;
+      };
     };
   };
 }