diff --git a/modules/services/logging/syslogd.nix b/modules/services/logging/syslogd.nix index 083568b51e30..bb088c250f6b 100644 --- a/modules/services/logging/syslogd.nix +++ b/modules/services/logging/syslogd.nix @@ -27,8 +27,6 @@ let *.*;mail.none;local1.none -/var/log/messages ''; - syslogdParameters = if cfg.enableNetworkInput then "-r " else ""; - in { @@ -75,6 +73,15 @@ in ''; }; + extraParams = mkOption { + type = types.listOf types.string; + default = [ ]; + example = [ "-m 0" ]; + description = '' + Additional parameters passed to syslogd. + ''; + }; + }; }; @@ -84,6 +91,8 @@ in config = { + services.syslogd.extraParams = optional cfg.enableNetworkInput "-r"; + jobs.syslogd = { description = "Syslog daemon"; @@ -93,7 +102,7 @@ in daemonType = "fork"; - exec = "${pkgs.sysklogd}/sbin/syslogd ${syslogdParameters} -f ${syslogConf}"; + exec = "${pkgs.sysklogd}/sbin/syslogd ${toString cfg.extraParams} -f ${syslogConf}"; }; }; diff --git a/modules/testing/test-instrumentation.nix b/modules/testing/test-instrumentation.nix index d1b3fe154d57..e2434aeb9ecb 100644 --- a/modules/testing/test-instrumentation.nix +++ b/modules/testing/test-instrumentation.nix @@ -92,6 +92,10 @@ in # Send all of /var/log/messages to the serial port. services.syslogd.extraConfig = "*.* /dev/ttyS0"; + # Disable "-- MARK --" messages. These prevent hanging tests from + # being killed after 1 hour of silence. + services.syslogd.extraParams = [ "-m 0" ]; + # Don't run klogd. Kernel messages appear on the serial console anyway. jobs.klogd.startOn = mkOverride 50 "";