summary refs log tree commit diff
path: root/nixos/modules/system/boot/systemd.nix
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2018-09-29 12:16:45 -0700
committerJamey Sharp <jamey@minilop.net>2018-09-30 11:04:43 -0700
commit10e865051548f39e8bff205ea09a648c49304d11 (patch)
treed7890607025f18d7f2d3fdafc4441c802dcad3ff /nixos/modules/system/boot/systemd.nix
parent8d40083690c2d20d20c32d7d90b9fd7b7f559042 (diff)
downloadnixlib-10e865051548f39e8bff205ea09a648c49304d11.tar
nixlib-10e865051548f39e8bff205ea09a648c49304d11.tar.gz
nixlib-10e865051548f39e8bff205ea09a648c49304d11.tar.bz2
nixlib-10e865051548f39e8bff205ea09a648c49304d11.tar.lz
nixlib-10e865051548f39e8bff205ea09a648c49304d11.tar.xz
nixlib-10e865051548f39e8bff205ea09a648c49304d11.tar.zst
nixlib-10e865051548f39e8bff205ea09a648c49304d11.zip
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.
Diffstat (limited to 'nixos/modules/system/boot/systemd.nix')
-rw-r--r--nixos/modules/system/boot/systemd.nix5
1 files changed, 1 insertions, 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;