summary refs log tree commit diff
path: root/pkgs/os-specific/linux/systemd/reexec.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/systemd/reexec.patch')
-rw-r--r--pkgs/os-specific/linux/systemd/reexec.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/systemd/reexec.patch b/pkgs/os-specific/linux/systemd/reexec.patch
new file mode 100644
index 000000000000..ff13a44ca0b2
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/reexec.patch
@@ -0,0 +1,15 @@
+Make "systemctl daemon-reexec" do the right thing on NixOS.
+
+diff --git a/src/core/main.c b/src/core/main.c
+index 04fc0b3..0f5b0e9 100644
+--- a/src/core/main.c
++++ b/src/core/main.c
+@@ -1819,7 +1819,7 @@ finish:
+                         char_array_0(sfd);
+ 
+                         i = 0;
+-                        args[i++] = SYSTEMD_BINARY_PATH;
++                        args[i++] = "/run/current-system/systemd/lib/systemd/systemd";
+                         if (switch_root_dir)
+                                 args[i++] = "--switched-root";
+                         args[i++] = arg_running_as == SYSTEMD_SYSTEM ? "--system" : "--user";