summary refs log tree commit diff
path: root/nixos
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
parent8d40083690c2d20d20c32d7d90b9fd7b7f559042 (diff)
downloadnixpkgs-10e865051548f39e8bff205ea09a648c49304d11.tar
nixpkgs-10e865051548f39e8bff205ea09a648c49304d11.tar.gz
nixpkgs-10e865051548f39e8bff205ea09a648c49304d11.tar.bz2
nixpkgs-10e865051548f39e8bff205ea09a648c49304d11.tar.lz
nixpkgs-10e865051548f39e8bff205ea09a648c49304d11.tar.xz
nixpkgs-10e865051548f39e8bff205ea09a648c49304d11.tar.zst
nixpkgs-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')
-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 94bbd6180a8..c0d1bd75065 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;