Skip to content

Commit

Permalink
packages/nixos: write Kata agent output to console and journal
Browse files Browse the repository at this point in the history
Previously, we only wrote Kata agent output to the console / TTY (which is also what it does upstream [^1]). This makes the output appear in the Kata runtime logs on the Host via the `vmconsole=` field. However, when debugging from within the pod VM, it's helpful to also have the logs in there so that they can be searched in with `journalctl`. This makes it so the output of the agent is written to both the console _and_ the journal.

[^1]: https://github.com/kata-containers/kata-containers/blob/3.10.1/src/agent/kata-agent.service.in
  • Loading branch information
msanft committed Dec 19, 2024
1 parent 6c6fbaf commit 93bab49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nixos/kata.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ in
after = [ "systemd-tmpfiles-setup.service" ]; # Not upstream, but required for /etc/resolv.conf bind mount.
serviceConfig = {
Type = "exec"; # Not upstream.
StandardOutput = "tty";
StandardOutput = "journal+console";
StandardError = "inherit";
ExecStart = "${lib.getExe pkgs.kata-agent}";
LimitNOFILE = 1048576;
ExecStop = "${pkgs.coreutils}/bin/sync ; ${config.systemd.package}/bin/systemctl --force poweroff";
Expand Down

0 comments on commit 93bab49

Please sign in to comment.