diff options
author | Chris Rees <crees@FreeBSD.org> | 2016-08-11 21:06:42 +0000 |
---|---|---|
committer | Chris Rees <crees@FreeBSD.org> | 2016-08-11 21:06:42 +0000 |
commit | aa463ad2ec00fc013e7dc0d5900cb4da5f5bba4e (patch) | |
tree | 7337c30035019b65de576703b0b38d40accc1466 /sysutils/runit/files/patch-src_runit.c | |
parent | Update to version 4.11.0 (diff) |
Add pkg-message with hints on replacing init
Patch to allow running from PREFIX without copying (caveat-- must be on root
filesystem!)
Various minor runtime fixes
Notes
Notes:
svn path=/head/; revision=420105
Diffstat (limited to 'sysutils/runit/files/patch-src_runit.c')
-rw-r--r-- | sysutils/runit/files/patch-src_runit.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/sysutils/runit/files/patch-src_runit.c b/sysutils/runit/files/patch-src_runit.c new file mode 100644 index 000000000000..04331517103b --- /dev/null +++ b/sysutils/runit/files/patch-src_runit.c @@ -0,0 +1,51 @@ +$FreeBSD$ + +Should the user neglect to add the symlink, rather than stick them in a +reboot loop give a warning. + +--- src/runit.c.orig 2016-08-10 21:03:05 UTC ++++ src/runit.c +@@ -22,10 +22,13 @@ + #define WARNING "- runit: warning: " + #define FATAL "- runit: fatal: " + +-const char * const stage[3] ={ ++const char * const stage[] ={ + "/etc/runit/1", + "/etc/runit/2", +- "/etc/runit/3" }; ++ "/etc/runit/3", ++ PREFIX "/etc/runit/1", ++ PREFIX "/etc/runit/2", ++ PREFIX "/etc/runit/3" }; + + int selfpipe[2]; + int sigc =0; +@@ -134,6 +137,13 @@ int main (int argc, const char * const * + + strerr_warn3(INFO, "enter stage: ", stage[st], 0); + execve(*prog, (char *const *)prog, envp); ++ /* Try with PREFIX */ ++ prog[0] = stage[st+3]; ++ strerr_warn3(INFO, ++ "Trying in " PREFIX "; not found in /etc: ", stage[st], 0); ++ strerr_warn3(INFO, ++ "Must run ln -s " PREFIX "/etc/runit /etc/ to work!", stage[st], 0); ++ execve(*prog, (char *const *)prog, envp); + strerr_die4sys(0, FATAL, "unable to start child: ", stage[st], ": "); + } + +@@ -229,6 +239,13 @@ int main (int argc, const char * const * + /* child */ + strerr_warn3(INFO, "enter stage: ", prog[0], 0); + execve(*prog, (char *const *) prog, envp); ++ /* Try with PREFIX */ ++ prog[0] = stage[st+3]; ++ strerr_warn3(INFO, ++ "Trying in " PREFIX "; not found: ", stage[st], 0); ++ strerr_warn3(INFO, ++ "Must run ln -s " PREFIX "/etc/runit /etc/ to work!", stage[st], 0); ++ execve(*prog, (char *const *) prog, envp); + strerr_die4sys(0, FATAL, "unable to start child: ", prog[0], ": "); + } + if (wait_pid(&wstat, pid2) == -1) |