summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2015-01-02 18:10:51 +0100
committerPeter Simons <simons@cryp.to>2015-01-02 18:10:51 +0100
commit68ab9b7958550ac8dd3baab473b41eba7859d1bd (patch)
treee65556f936a4b8ffa250c86ae2e5dce550874a46 /pkgs/os-specific
parent1f523bb23d518bb6eddc632b7840388dcad2b69e (diff)
parent14eff8f7fa4a0d020ba0c9348b53ce92e85f78dc (diff)
downloadnixpkgs-68ab9b7958550ac8dd3baab473b41eba7859d1bd.tar
nixpkgs-68ab9b7958550ac8dd3baab473b41eba7859d1bd.tar.gz
nixpkgs-68ab9b7958550ac8dd3baab473b41eba7859d1bd.tar.bz2
nixpkgs-68ab9b7958550ac8dd3baab473b41eba7859d1bd.tar.lz
nixpkgs-68ab9b7958550ac8dd3baab473b41eba7859d1bd.tar.xz
nixpkgs-68ab9b7958550ac8dd3baab473b41eba7859d1bd.tar.zst
nixpkgs-68ab9b7958550ac8dd3baab473b41eba7859d1bd.zip
Merge pull request #5523 from nckx/util-linux-path
util-linux: fix rtcwake(8) to search $PATH for shutdown(8)
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix2
-rw-r--r--pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patch30
2 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 3b76eb63ea5..3977afb3158 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "e0457f715b73f4a349e1acb08cb410bf0edc9a74a3f75c357070f31f70e33cd6";
   };
 
+  patches = [ ./rtcwake-search-PATH-for-shutdown.patch ];
+
   crossAttrs = {
     # Work around use of `AC_RUN_IFELSE'.
     preConfigure = "export scanf_cv_type_modifier=ms";
diff --git a/pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patch b/pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patch
new file mode 100644
index 00000000000..92cb07d4383
--- /dev/null
+++ b/pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patch
@@ -0,0 +1,30 @@
+Search $PATH for the shutdown binary instead of hard-coding /sbin/shutdown,
+which isn't valid on NixOS (and a compatibility link on most other modern
+distros anyway).
+
+  -- nckx <tobias.geerinckx.rice@gmail.com>
+
+diff -Naur a/include/pathnames.h b/include/pathnames.h
+--- a/include/pathnames.h	2014-09-16 14:37:06.138551680 +0200
++++ b/include/pathnames.h	2015-01-01 20:41:02.510948314 +0100
+@@ -43,7 +43,7 @@
+ #define _PATH_INITTAB		"/etc/inittab"
+ #define _PATH_RC		"/etc/rc"
+ #define _PATH_REBOOT		"/sbin/reboot"
+-#define _PATH_SHUTDOWN		"/sbin/shutdown"
++#define _PATH_SHUTDOWN		"shutdown"
+ #define _PATH_SINGLE		"/etc/singleboot"
+ #define _PATH_SHUTDOWN_CONF	"/etc/shutdown.conf"
+ 
+diff -Naur a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c
+--- a/sys-utils/rtcwake.c	2014-10-24 11:21:20.447389309 +0200
++++ b/sys-utils/rtcwake.c	2015-01-01 20:57:59.398911209 +0100
+@@ -582,7 +582,7 @@
+ 		arg[i]   = NULL;
+ 
+ 		if (!dryrun) {
+-			execv(arg[0], arg);
++			execvp(arg[0], arg);
+ 
+ 			warn(_("failed to execute %s"), _PATH_SHUTDOWN);
+ 			rc = EXIT_FAILURE;