Commit afdd737c authored by Will Fancher's avatar Will Fancher
Browse files

nixos/tests: Fix systemd-shutdown

Since 459ddaec, stdout of PID 1
and children such as systemd generators and systemd-shutdown scripts
goes to `tty0` instead of `ttyS0`. This is because systemd's stdout is
`/dev/console`, which represents only one tty at a time, as explained
here: https://docs.kernel.org/admin-guide/serial-console.html

The reason PID 1's own output makes it to both consoles is because
it uses kmsg as its log target both before journald has started and
once the `systemd-shutdown` executable takes control. Unlike
`/dev/console`, kmsg output makes it to one console *of each type*,
i.e. one VT and one serial console.
parent 52faf482
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ import ./make-test-python.nix (
      imports = [ ../modules/profiles/minimal.nix ];
      systemd.shutdownRamfs.contents."/etc/systemd/system-shutdown/shutdown-message".source =
        pkgs.writeShellScript "shutdown-message" ''
          echo "${msg}"
          echo "${msg}" > /dev/kmsg
        '';
      boot.initrd.systemd.enable = systemdStage1;
    };