---
diff -ruN a/runit-2.1.1/src/runit.c b/runit-2.1.1/src/runit.c
--- a/runit-2.1.1/src/runit.c 2009-10-04 13:44:02.000000000 -0700
+++ b/runit-2.1.1/src/runit.c 2013-10-10 16:03:21.738259966 -0700
_at_@ -22,10 +22,11 @@
#define WARNING "- runit: warning: "
#define FATAL "- runit: fatal: "
-const char * const stage[3] ={
+const char * const stage[4] ={
"/etc/runit/1",
"/etc/runit/2",
- "/etc/runit/3" };
+ "/etc/runit/3",
+ "/etc/runit/4" };
int selfpipe[2];
int sigc =0;
_at_@ -94,7 +95,17 @@
": booting.", 0);
/* runit */
- for (st =0; st < 3; st++) {
+ for (st =0; st < 4; st++) {
+ /* stage 4 gets control of pid 1 */
+ if (st == 3) {
+ if ((stat(stage[st], &s) != -1) && (s.st_mode & S_IXUSR)) {
+ prog[0] =stage[st];
+ prog[1] =0;
+ strerr_warn3(INFO, "enter stage: ", stage[st], 0);
+ execve(*prog, (char *const *)prog, envp);
+ strerr_die4sys(0, FATAL, "unable to exec: ", stage[st], ": ");
+ }
+ }
/* if (st == 2) logwtmp("~", "reboot", ""); */
while ((pid =fork()) == -1) {
strerr_warn4(FATAL, "unable to fork for \"", stage[st], "\" pausing: ",
This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:18 UTC