From 10e865051548f39e8bff205ea09a648c49304d11 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 29 Sep 2018 12:16:45 -0700 Subject: [PATCH] nixos/systemd: let journald create /var/log/journal The default value for journald's Storage option is "auto", which determines whether to log to /var/log/journal based on whether that directory already exists. So NixOS has been unconditionally creating that directory in activation scripts. However, we can get the same behavior by configuring journald.conf to set Storage to "persistent" instead. In that case, journald will create the directory itself if necessary. --- nixos/modules/system/boot/systemd.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 94bbd6180a80..c0d1bd750655 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -747,6 +747,7 @@ in "systemd/journald.conf".text = '' [Journal] + Storage=persistent RateLimitInterval=${config.services.journald.rateLimitInterval} RateLimitBurst=${toString config.services.journald.rateLimitBurst} ${optionalString (config.services.journald.console != "") '' @@ -786,10 +787,6 @@ in system.activationScripts.systemd = '' mkdir -m 0755 -p /var/lib/udev - - # Keep a persistent journal. Note that systemd-tmpfiles will - # set proper ownership/permissions. - mkdir -m 0700 -p /var/log/journal ''; users.users.systemd-network.uid = config.ids.uids.systemd-network;