Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Feb 2015 18:55:01 +0000 (GMT)
From:      Rui Paulo <rpaulo@me.com>
To:        perryh@pluto.rain.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: RFC: make init(8) aware of /rescue/sh
Message-ID:  <57cd8ba3-e391-45f1-adae-2806800e4a97@me.com>

next in thread | raw e-mail | index | archive | help
On Feb 11, 2015, at 02:31 AM, perryh@pluto.rain.com (Perry Hutchison) wrot=
e:=0A=0ASeems to me it might be desirable for init(8) to fall back=0Ato /r=
escue/sh for single-user mode if neither the default=0A(kenv:init_shell) n=
or /bin/sh is usable. Thoughts?=0A=0A(Patch generated against stable/8, bu=
t will likely apply to=0AHEAD also -- not much has changed in init.)=0A=0A=
--- init.c-orig=0A+++ init.c=0A@@ -79,6 +79,9 @@=0A#include <login_cap.h>=0A=
#endif=0A=0A+/* Ideally this value should come from the RESCUE side of pat=
hs.h */=0A+#define =C2=A0 =C2=A0 =C2=A0 =C2=A0_PATH_R_BSHELL =C2=A0 =C2=A0=
"/rescue/sh"=0A+=0A#include "pathnames.h"=0A=0A/*=0A@@ -706,7 +709,8 @@=0A=
=0A=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/*=0A=C2=A0 =C2=A0 =C2=A0 * Fire off =
a shell.=0A- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * If the default one doesn=
't work, try the Bourne shell.=0A+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 * If the default one doesn't work, try the Bourne shell;=0A+ =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * if that doesn't work either, try the rescue=
 shell.=0A=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */=0A=0A=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0char name[] =3D "-sh";=0A@@ -717,6 +721,8 @@=0A=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0emergency("can't exec %s f=
or single user: %m", shell);=0A=C2=A0 =C2=A0 =C2=A0execv(_PATH_BSHELL, arg=
v);=0A=C2=A0 =C2=A0 =C2=A0emergency("can't exec %s for single user: %m", _=
PATH_BSHELL);=0A+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0execv(_PATH_R_B=
SHELL, argv);=0A+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0emergency("can't exec =
%s for single user: %m", _PATH_R_BSHELL);=0A=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0sleep(STALL_TIMEOUT);=0A=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0_exit(1);=0A=C2=A0 =C2=A0}=0A=C2=A0=0AThis makes sense to me=
. :-)=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?57cd8ba3-e391-45f1-adae-2806800e4a97>