git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #5523 from nckx/util-linux-path

util-linux: fix rtcwake(8) to search $PATH for shutdown(8)

commit68ab9b7958550ac8dd3baab473b41eba7859d1bd authorPeter Simons <simons@cryp.to> dateFri 2 Jan 2015, 18:10 (12 years ago) parent1f523bb14eff8f
2 files changed+32
pkgs/os-specific/linux/util-linux/default.nix+2 pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patch+30
pkgs/os-specific/linux/util-linux/default.nix+2
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
88 sha256 = "e0457f715b73f4a349e1acb08cb410bf0edc9a74a3f75c357070f31f70e33cd6";
99 };
1010
11+ patches = [ ./rtcwake-search-PATH-for-shutdown.patch ];
12+
1113 crossAttrs = {
1214 # Work around use of `AC_RUN_IFELSE'.
1315 preConfigure = "export scanf_cv_type_modifier=ms";
pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patchnew file+30
@@ -0,0 +1,30 @@
1+Search $PATH for the shutdown binary instead of hard-coding /sbin/shutdown,
2+which isn't valid on NixOS (and a compatibility link on most other modern
3+distros anyway).
4+
5+ -- nckx <tobias.geerinckx.rice@gmail.com>
6+
7+diff -Naur a/include/pathnames.h b/include/pathnames.h
8+--- a/include/pathnames.h 2014-09-16 14:37:06.138551680 +0200
9++++ b/include/pathnames.h 2015-01-01 20:41:02.510948314 +0100
10+@@ -43,7 +43,7 @@
11+ #define _PATH_INITTAB "/etc/inittab"
12+ #define _PATH_RC "/etc/rc"
13+ #define _PATH_REBOOT "/sbin/reboot"
14+-#define _PATH_SHUTDOWN "/sbin/shutdown"
15++#define _PATH_SHUTDOWN "shutdown"
16+ #define _PATH_SINGLE "/etc/singleboot"
17+ #define _PATH_SHUTDOWN_CONF "/etc/shutdown.conf"
18+
19+diff -Naur a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c
20+--- a/sys-utils/rtcwake.c 2014-10-24 11:21:20.447389309 +0200
21++++ b/sys-utils/rtcwake.c 2015-01-01 20:57:59.398911209 +0100
22+@@ -582,7 +582,7 @@
23+ arg[i] = NULL;
24+
25+ if (!dryrun) {
26+- execv(arg[0], arg);
27++ execvp(arg[0], arg);
28+
29+ warn(_("failed to execute %s"), _PATH_SHUTDOWN);
30+ rc = EXIT_FAILURE;