Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Apr 2000 01:26:20 +0930
From:      Mark Newton <newton@atdot.dotat.org>
To:        "Jeroen C. van Gelderen" <jeroen@vangelderen.org>
Cc:        Satoshi - Ports Wraith - Asami <asami@freebsd.org>, Peter Wemm <peter@netplex.com.au>, Warner Losh <imp@village.org>, Poul-Henning Kamp <phk@critter.freebsd.dk>, Brian Somers <brian@Awfulhak.org>, "David E. O'Brien" <obrien@freebsd.org>, cvs-committers@freebsd.org, cvs-all@freebsd.org, freebsd-arch@freebsd.org
Subject:   Re: cvs commit: src/contrib/tcsh - Imported sources
Message-ID:  <20000419012620.C3348@atdot.dotat.org>
In-Reply-To: <38FA4969.B3BF2DB2@vangelderen.org>; from jeroen@vangelderen.org on Sun, Apr 16, 2000 at 07:14:49PM -0400
References:  <20000415231805.33B311CD7@overcee.netplex.com.au> <vqcya6e8m81.fsf@silvia.hip.berkeley.edu> <38FA4969.B3BF2DB2@vangelderen.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Apr 16, 2000 at 07:14:49PM -0400, Jeroen C. van Gelderen wrote:

 > So, assuming that we keep tcsh in the base system (why not, there's an
 > awful lot of people using it), we have:
 >  1. csh addicts typing chpass -s csh and be done with it
 > or
 >  2. frustrated new users trying to figure out that they need/want to
 > type 
 >     chpass -s sh
 
Not trying to start a flame war here, but we can actually go a step
further.

Traditionally, an empty shell field in /etc/passwd has meant that /bin/sh
is the user's shell.

We can use that tradition to make the choice of shell more friendly.
Here's the idea:

  1.  When new accounts are created, default to an empty shell field in
      their passwd file entry;

  2.  Modify the default /etc/profile so that it checks to see if the
      shell field is empty or not.  If it is empty, present the user with
      a list of shells obtained from /etc/shells and ask them which one
      they want to use.  Default to the shell saved in adduser.conf if
      nothing is entered, or /bin/csh if adduser.conf doesn't exist.

  3.  Based on their choice, run "chpass -s" to set the user's shell to
      whatever it is that they've wanted.

  4.  Tell the user that they'll now need to login again, then exit.  Next
      time they login the test in (2) will see that the shell field is 
      non-empty, and won't ask any stupid questions.

That means the user is asked about which shell they want when they login
for the first time, after that they won't be bothered again.  Note that
this only affects actual logins, because it'd be done out of /etc/profile,
so most role accounts (which are typically accessed via "su", not via a 
login session) would continue to work in the same way they've always worked,
but accounts which are actually used for real-live login sessions can
be customized by the user when they login for the first time.  Furthermore,
if a site wishes to standardize on a certain shell, or if the sysadmin
who sets up someone's account already knows their preference, that's ok too:
the shell field can be preinitialized with whatever is supposed to go there.

Note that this means that most current practices will remain unchanged;
the only real change is that accounts with unspecified shells present a
menu upon the first login (but not the first "su").  The only file which
needs to be updated to achieve this outcome is /etc/profile.

 > What do the csh users think? Is typing "chpass -s csh" too much of an
 > inconvenience?

For people who don't know about the chpass command, yes.  So turn it 
into a "choose from the following options..." style of menu.

    - mark

--------------------------------------------------------------------
I tried an internal modem,                    newton@atdot.dotat.org
     but it hurt when I walked.                          Mark Newton
----- Voice: +61-4-1620-2223 ------------- Fax: +61-8-82231777 -----




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




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