about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2015-05-31 19:55:33 +0300
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-22 12:27:05 +0200
commit5d02c02a9bfd6912e4e0f700b1b35e76d1d6bd3f (patch)
tree6ca0b40bc32751f66db340175509d74f330e1d0d
parenteedda353f30b1e4317096b4367e15fedd79c29f6 (diff)
downloadnixlib-5d02c02a9bfd6912e4e0f700b1b35e76d1d6bd3f.tar
nixlib-5d02c02a9bfd6912e4e0f700b1b35e76d1d6bd3f.tar.gz
nixlib-5d02c02a9bfd6912e4e0f700b1b35e76d1d6bd3f.tar.bz2
nixlib-5d02c02a9bfd6912e4e0f700b1b35e76d1d6bd3f.tar.lz
nixlib-5d02c02a9bfd6912e4e0f700b1b35e76d1d6bd3f.tar.xz
nixlib-5d02c02a9bfd6912e4e0f700b1b35e76d1d6bd3f.tar.zst
nixlib-5d02c02a9bfd6912e4e0f700b1b35e76d1d6bd3f.zip
systemd: Use upstream tmpfiles.d rules
This fixes a failing assert in systemd-timesyncd (issue #5913) as it
expects the directory /run/systemd/netif/links/ to exist, and nothing in
NixOS currently creates it.

Also we get a net reduction in our code as rules for /run/utmp and
/var/log/journal are also provided by the same upstream file.

(cherry picked from commit a278a9224a3c1c5db399d53c86b36a25133b5cda)
-rw-r--r--nixos/modules/system/activation/activation-script.nix4
-rw-r--r--nixos/modules/system/boot/systemd.nix12
2 files changed, 1 insertions, 15 deletions
diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix
index 2e5a70b3aa54..02b3e25a313d 100644
--- a/nixos/modules/system/activation/activation-script.nix
+++ b/nixos/modules/system/activation/activation-script.nix
@@ -114,10 +114,6 @@ in
       ''
         # Various log/runtime directories.
 
-        touch /run/utmp # must exist
-        chgrp ${toString config.ids.gids.utmp} /run/utmp
-        chmod 664 /run/utmp
-
         mkdir -m 0755 -p /run/nix/current-load # for distributed builds
         mkdir -m 0700 -p /run/nix/remote-stores
 
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index f6113188b030..1314b7277723 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -639,13 +639,6 @@ in
     system.activationScripts.systemd = stringAfter [ "groups" ]
       ''
         mkdir -m 0755 -p /var/lib/udev
-        mkdir -p /var/log/journal
-        chmod 0755 /var/log/journal
-
-        # Make all journals readable to users in the wheel and adm
-        # groups, in addition to those in the systemd-journal group.
-        # Users can always read their own journals.
-        ${pkgs.acl}/bin/setfacl -nm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal || true
 
         if ! [ -e /etc/machine-id ]; then
           ${systemd}/bin/systemd-machine-id-setup
@@ -731,6 +724,7 @@ in
         startSession = true;
       };
 
+    environment.etc."tmpfiles.d/systemd.conf".source = "${systemd}/example/tmpfiles.d/systemd.conf";
     environment.etc."tmpfiles.d/x11.conf".source = "${systemd}/example/tmpfiles.d/x11.conf";
 
     environment.etc."tmpfiles.d/nixos.conf".text =
@@ -738,10 +732,6 @@ in
         # This file is created automatically and should not be modified.
         # Please change the option ‘systemd.tmpfiles.rules’ instead.
 
-        z /var/log/journal 2755 root systemd-journal - -
-        z /var/log/journal/%m 2755 root systemd-journal - -
-        z /var/log/journal/%m/* 0640 root systemd-journal - -
-
         ${concatStringsSep "\n" cfg.tmpfiles.rules}
       '';