git.iko.soy/typeable/nixpkgs
on master help sign in
X server: Log to the journal instead of /var/log/X.0.log

This ensures that "journalctl -u display-manager" does what you would expect in 2016. However, the main reason is to ensure that our VM tests show the output of the X server. A slight problem is that with KDE user switching, messages from the various X servers end up in the same place. However, that's an improvement over the previous situation, where the second X server would overwrite the /var/log/X.0.log of the first. (This was caused by the fact that we were passing a hard-coded value for -logfile.)

commitd84741a4bfb6ed2531ec7154479c147d2c9a737c authorEelco Dolstra <eelco.dolstra@logicblox.com> dateTue 24 May 2016, 21:07 (11 years ago) parent012313f
2 files changed+4−2
nixos/modules/services/x11/display-managers/kdm.nix+1−1 nixos/modules/services/x11/xserver.nix+3−1
nixos/modules/services/x11/display-managers/kdm.nix+1−1
@@ -139,7 +139,7 @@ in
139139 mkdir -m 0755 -p /var/lib/kdm
140140 chown kdm /var/lib/kdm
141141 ${(optionalString (config.system.boot.loader.id == "grub" && config.system.build.grub != null) "PATH=${config.system.build.grub}/sbin:$PATH ") +
142− "KDEDIRS=/run/current-system/sw exec ${kdebase_workspace}/bin/kdm -config ${kdmrc} -nodaemon"}
142+ "KDEDIRS=/run/current-system/sw exec ${kdebase_workspace}/bin/kdm -config ${kdmrc} -nodaemon -logfile /dev/stderr"}
143143 '';
144144 logsXsession = true;
145145 };
nixos/modules/services/x11/xserver.nix+3−1
@@ -520,6 +520,7 @@ in
520520 serviceConfig = {
521521 Restart = "always";
522522 RestartSec = "200ms";
523+ SyslogIdentifier = "display-manager";
523524 };
524525 };
525526
@@ -527,10 +528,11 @@ in
527528 [ "-terminate"
528529 "-config ${configFile}"
529530 "-xkbdir" "${cfg.xkbDir}"
531+ # Log at the default verbosity level to stderr rather than /var/log/X.*.log.
532+ "-verbose" "3" "-logfile" "/dev/null"
530533 ] ++ optional (cfg.display != null) ":${toString cfg.display}"
531534 ++ optional (cfg.tty != null) "vt${toString cfg.tty}"
532535 ++ optional (cfg.dpi != null) "-dpi ${toString cfg.dpi}"
533− ++ optionals (cfg.display != null) [ "-logfile" "/var/log/X.${toString cfg.display}.log" ]
534536 ++ optional (!cfg.enableTCP) "-nolisten tcp";
535537
536538 services.xserver.modules =