Skip to content

Commit

Permalink
log-vm: module for systemd-journal-upload service
Browse files Browse the repository at this point in the history
* run service to upload journal to log-vm
  - tested only to start without errors
* formatting (nix fmt)

Signed-off-by: Ville Ilvonen <ville.ilvonen@unikie.com>
  • Loading branch information
vilvo committed Apr 19, 2024
1 parent 7f1c079 commit c3e5544
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
20 changes: 20 additions & 0 deletions modules/common/log/journal-remote-upload.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{pkgs, ...}: let
log-vm-ip-port = "192.168.101.66:19532";
in {
users.users.systemd-journal-upload = {
isSystemUser = true;
group = "systemd-journal-upload";
};
users.groups.systemd-journal-upload = {};

systemd.services.systemd-journal-upload = {
enable = true;
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";
};

wantedBy = ["multi-user.target"];
};
}
2 changes: 1 addition & 1 deletion modules/microvm/virtualization/microvm/logvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
group = "systemd-journal";
};

systemd.tmpfiles.rules = [ "d /var/log/journal/remote 755 systemd-journal-remote systemd-journal" ];
systemd.tmpfiles.rules = ["d /var/log/journal/remote 755 systemd-journal-remote systemd-journal"];

systemd.services.systemd-journal-remote = {
enable = true;
Expand Down
2 changes: 2 additions & 0 deletions targets/lenovo-x1/everything.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

self.nixosModules.disko-lenovo-x1-basic-v1

../../modules/common/log/journal-remote-upload.nix

./sshkeys.nix
({
pkgs,
Expand Down

0 comments on commit c3e5544

Please sign in to comment.