Skip to content

Commit

Permalink
log-vm: starting systemd-journal-remote service in log-vm
Browse files Browse the repository at this point in the history
Without this patch if ghaf-host tries to do `systemd-journal-upload`
there will be following error "Failed to connect to 192.168.101.66
port 19532 after 0 ms: Couldn't connect to server".
As there will be no listener running in log-vm to accept logs.

With this patch we add listener in log-vm on 19532 port to accept logs.
Now `remote.service` is failing frequently with following error
"failed: Send failure: Connection reset by peer", however logs are
getting copied in log-vm from ghaf-host.
remote.service failure needs further debugging.

Signed-off-by: Vunny Sodhi <vunny.sodhi@unikie.com>
  • Loading branch information
vunnyso committed Apr 24, 2024
1 parent 0d1e4fe commit 2b64843
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/common/log/journal-remote-upload.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ in {
group = "systemd-journal-upload";
};
users.groups.systemd-journal-upload = {};
users.users.systemd-journal-upload.extraGroups = ["systemd-journal"];

systemd.services.systemd-journal-upload = {
description = "Service to upload journal logs to log-vm";
enable = true;
after = ["network-online.target"];
serviceConfig = {
#ExecStart = "${pkgs.systemd}/lib/systemd/systemd-journal-upload --save-state -u http://${log-vm-ip-port}";
ExecStart = "${pkgs.systemd}/lib/systemd/systemd-journal-upload -u http://${log-vm-ip-port}";
User = "systemd-journal-upload";
Restart = "on-failure";
RestartSec = "1";
};

wantedBy = ["multi-user.target"];
Expand Down
5 changes: 5 additions & 0 deletions modules/microvm/virtualization/microvm/logvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@

systemd.services.systemd-journal-remote = {
enable = true;
serviceConfig = {
ExecStart = "${pkgs.systemd}/lib/systemd/systemd-journal-remote --listen-raw=19532 --output=/var/log/journal/remote";
User = "systemd-journal-remote";
};
wantedBy = ["multi-user.target"];
};

microvm = {
Expand Down

0 comments on commit 2b64843

Please sign in to comment.