Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

journald not saving logs to disk #9614

Closed
ktosiek opened this issue Sep 2, 2015 · 1 comment
Closed

journald not saving logs to disk #9614

ktosiek opened this issue Sep 2, 2015 · 1 comment

Comments

@ktosiek
Copy link
Contributor

ktosiek commented Sep 2, 2015

After installing NixOS from http://hydra.nixos.org/build/25226407/download/1/nixos-graphical-15.09.24.4a63983-x86_64-linux.iso there was no /var/log/journal/.
As journald is by default guessing if it should write logs to disk based on that directories existance, all my logs were getting saved to /run/log/.

Shouldn't we use Storage=persistent by default?

@dezgeg
Copy link
Contributor

dezgeg commented Sep 2, 2015

Hmm, I can see this as well. It's probably 5d02c02, sounds like this might be needed as well (EDIT: bleh, this doesn't create the journal directory either):

diff --git nixos/modules/system/boot/systemd.nix nixos/modules/system/boot/systemd.nix
index 05369da..f290253 100644
--- nixos/modules/system/boot/systemd.nix
+++ nixos/modules/system/boot/systemd.nix
@@ -733,6 +733,7 @@ in
       };

     environment.etc."tmpfiles.d/systemd.conf".source = "${systemd}/example/tmpfiles.d/systemd.conf";
+    environment.etc."tmpfiles.d/var.conf".source = "${systemd}/example/tmpfiles.d/var.conf";
     environment.etc."tmpfiles.d/x11.conf".source = "${systemd}/example/tmpfiles.d/x11.conf";

     environment.etc."tmpfiles.d/nixos.conf".text =

Details: in systemd.conf, we have

z /var/log/journal 2755 root systemd-journal - -
z /var/log/journal/%m 2755 root systemd-journal - -

but looks like that's not actually enough (man tmpfiles.d):

       z
           Adjust the access mode, group and user, and restore the SELinux security context of a file or directory, if it exists. Lines of this type accept shell-style globs in place of normal path names. Does not follow symlinks.

edolstra added a commit that referenced this issue Sep 3, 2015
Fixes #9614.

(cherry picked from commit 6ab7e0d)
adrianpk added a commit to adrianpk/nixpkgs that referenced this issue May 31, 2024
Fixes NixOS#9614.

(cherry picked from commit 6ab7e0d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants