From owner-freebsd-questions Sat Apr 10 11:51:24 1999 Delivered-To: freebsd-questions@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id E1C2814C07 for ; Sat, 10 Apr 1999 11:51:22 -0700 (PDT) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.8.8) id OAA13769; Sat, 10 Apr 1999 14:49:08 -0400 (EDT) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199904101849.OAA13769@cc942873-a.ewndsr1.nj.home.com> Subject: Re: login shell selection prompt In-Reply-To: <19990410222804.05084@welearn.com.au> from Sue Blake at "Apr 10, 99 10:28:04 pm" To: sue@welearn.com.au (Sue Blake) Date: Sat, 10 Apr 1999 14:49:08 -0400 (EDT) Cc: dm@k12-nis-2.bbn.com, freebsd-questions@FreeBSD.ORG Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sue Blake wrote, Hi, Sue! > On Fri, Apr 09, 1999 at 07:51:59PM -0400, david mankins wrote: > >> > >> Date: Sat, 10 Apr 1999 04:51:40 +1000 > >> From: Sue Blake > >> > >> When booting in single-user mode, root is asked to select which shell > >> to use at login. I'd like to get that prompt at login for a normal > >> user. > >> > >> I don't want to load a shell and then have the user change it, because > >> I'm trying to save a few bytes of memory when arriving to soothe a > >> choking 386. > >> > >> Is it easy to set this up somewhere? A man page name would be enough. This seems easy enough to do with a shells script[0], but... > So... the normal shell loads and uses memory, then the second shell > loads and uses more memory? Actually I thought with exec the first > shell gets ditched and replaced by the second less hungry shell, but > it's still too late mate. The first shell has already gobbled up those > few extra bytes of memory, and that could be enough to upset the ailing > machine. You say that an 'exec' is not good enough. You seem to indicate that a brief moment during an exec when both the original shell and the new one being fired up might exist in memory together might be too much for your lil' 386. I'm not exactly sure of the memory dynamics of a shell's exec command and whether that is a real concern, but a way to get around it would be a simple C program of your own. > Does anyone happen to know for sure if there is or is not a way to do it? > Or does anyone know what it is that's responsible for presenting that > shell question in single user mode? I might be able to work it out from > there. The single user prompting takes place in 'init.' See the source in, /usr/src/sbin/init/init.c And look for the single_user() function. [0] It's just such an easy script, #!/bin/sh echo -n "Enter full pathname of shell or RETURN for /bin/sh: " read USER_SHELL exec $USER_SHELL # Only reached on error echo "Bad pathname" exit 1 -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message