Re: [dev] [PATCH] Check for presence of SHELL environment variable

From: <k0ga_AT_shike2.com>
Date: Wed, 29 Oct 2014 21:52:14 +0100

Hi,

> - POSIX states the SHELL environment variable "... shall represent a
> pathname of the user's preferred command language interpreter." As

Well, this is a really complex topic. First because in this sentence
is not specified what is 'user's preferred command language
interpreter'. I read this sentence as 'SHELL variable must hold
always the value of the user preferred command in the /etc/passwd
file, and any program that create a session must be aware of setting
it from /etc/passwd'. The sentence doesn't say that the user's
preferred command language interpreter is the value of SHELL instead
of the value of /etc/passwd.

> such, st should check for its presence when deciding what shell to
> use; just as HOME can be defined to override one's passwd-defined home
> directory, a user should also be able to override their passwd-defined
> shell using the SHELL environment variable.

HOME must hold the value of the user's home directory, if this
value is not the value of /etc/passwd then you have an error
in your configuration. The same can be said about SHELL. You
can change your shell selection using chsh.

The problem here is what happens when you don't want to create a
session. For example, you only want to open a terminal emulator in a
serial line of your computer. It cannot be done with st because it
always create pseudo tty, so it cannot be connected to an existing
tty.

St is doing exactly the same work that login and utmp (and xterm and
all the terminal emulators), because it is creating a new session,
although it doesn't execute a login shell by default and it doesn't
create an utmp extry for this new session (I should add some of this
information to the FAQ), because it's the job of utmp.

The only solution as I can see is to split st in two programs, one for
the creation of the pseudo tty, and another for the terminal
emulation, and let to utmp all the management about the session, but
this is really a huge modification, and it also creates a dependence
between st and utmp, and it is something we want to avoid.

This is a point where moderm unix are broken.

Regards,
Received on Wed Oct 29 2014 - 21:52:14 CET

This archive was generated by hypermail 2.3.0 : Wed Oct 29 2014 - 22:00:11 CET