@@ -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;