From 4e4161c21268d6952f0f0f5130414e30dcf5cd97 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sat, 18 Feb 2017 15:01:32 +0100 Subject: [PATCH] systemd: setup tmpfiles on switching configuration This fixes systemd.tmpfiles.rules on switching configuration so that does not only get applied on a fresh boot. This e.g. fixes kubernetes. --- nixos/modules/system/activation/switch-to-configuration.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/system/activation/switch-to-configuration.pl b/nixos/modules/system/activation/switch-to-configuration.pl index 8747c1e3d4ac..ca7932a3c5cd 100644 --- a/nixos/modules/system/activation/switch-to-configuration.pl +++ b/nixos/modules/system/activation/switch-to-configuration.pl @@ -383,6 +383,10 @@ system("@systemd@/bin/systemctl", "reset-failed"); # Make systemd reload its units. system("@systemd@/bin/systemctl", "daemon-reload") == 0 or $res = 3; +# Set the new tmpfiles +print STDERR "setting up tmpfiles\n"; +system("@systemd@/bin/systemd-tmpfiles", "--create", "--remove", "--exclude-prefix=/dev") == 0 or $res = 3; + # Reload units that need it. This includes remounting changed mount # units. if (scalar(keys %unitsToReload) > 0) {