Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Apr 1999 22:28:04 +1000
From:      Sue Blake <sue@welearn.com.au>
To:        david mankins <dm@k12-nis-2.bbn.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: login shell selection prompt
Message-ID:  <19990410222804.05084@welearn.com.au>
In-Reply-To: <199904092352.TAA12362@k12-nis-2.bbn.com>; from david mankins on Fri, Apr 09, 1999 at 07:51:59PM -0400
References:  <19990410045140.50124@welearn.com.au> <199904092352.TAA12362@k12-nis-2.bbn.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <sue@welearn.com.au>
>> 
>> 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.

> chsh will let the users choose which shell is listed for them in
> /etc/passwd (so they don't have to ask for it whenever they log in).

Yep, thanks, but a login is required before chsh can be run, and that
login will be with the default bloated shell. That's no good:
If the machine did have enough life left in it to run the normal bloated
shell and chsh, then there wouldn't be any need to temporarily change the
shell to something tiny.
If the machine did not have enough life left in it to run the bloated
shell and chsh, it'd be dead before I got a second chance to login with
the lighter shell.

> if, ``arriving to soothe a choking 386'', you want to switch to the
> shell of *your* choice (instead of what the user is using),

The user will most likely be me or root. Not switch to a shell, but
elect to use the substitute shell _before_ the regular bloated shell
has a chance to load up and suck the last bit of life from the machine.

> you might
> want to use ``exec shell-of-your-choice''.  This command is an
> analogue of the exec system-call --- it overlays the current process
> with the new program.

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.

Of course the machine needs rebuilding so that it cannot get itself
into a situation where a few hundred kilobytes one way or the other
makes the difference between quick cleanup and forced reboot. But
before that happens I find this problem interesting and would like to
discover whether it does have a solution.

chsh is not a solution, and exec isn't either. Neither can prevent a
superfluous few hundred Kb being compulsarily gobbled up just to get to
a command prompt of any kind. Those are already part of the current
range of alternatives that do not offer any particular benefits in time
of crisis.

I'm looking for a way to be asked for a shell decision at login BEFORE
any shell is run. Yes, this is an unusual question and I don't imagine
it'll budge with the usual answers.

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.

-- 

Regards,
        -*Sue*-



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990410222804.05084>