Date: Wed, 11 Feb 2015 02:30:07 -0800 From: perryh@pluto.rain.com (Perry Hutchison) To: freebsd-hackers@freebsd.org Subject: RFC: make init(8) aware of /rescue/sh Message-ID: <54db2f2f.gIXyruGSeJuY3FbJ%perryh@pluto.rain.com>
next in thread | raw e-mail | index | archive | help
Seems to me it might be desirable for init(8) to fall back to /rescue/sh for single-user mode if neither the default (kenv:init_shell) nor /bin/sh is usable. Thoughts? (Patch generated against stable/8, but will likely apply to HEAD also -- not much has changed in init.) --- init.c-orig +++ init.c @@ -79,6 +79,9 @@ #include <login_cap.h> #endif +/* Ideally this value should come from the RESCUE side of paths.h */ +#define _PATH_R_BSHELL "/rescue/sh" + #include "pathnames.h" /* @@ -706,7 +709,8 @@ /* * Fire off a shell. - * If the default one doesn't work, try the Bourne shell. + * If the default one doesn't work, try the Bourne shell; + * if that doesn't work either, try the rescue shell. */ char name[] = "-sh"; @@ -717,6 +721,8 @@ emergency("can't exec %s for single user: %m", shell); execv(_PATH_BSHELL, argv); emergency("can't exec %s for single user: %m", _PATH_BSHELL); + execv(_PATH_R_BSHELL, argv); + emergency("can't exec %s for single user: %m", _PATH_R_BSHELL); sleep(STALL_TIMEOUT); _exit(1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54db2f2f.gIXyruGSeJuY3FbJ%perryh>