[11032] in Athena Bugs

home help back first fref pref prev next nref lref last post

Re: decmips 7.6F: session_gate

daemon@ATHENA.MIT.EDU (Calvin Clark)
Sun Sep 19 13:46:03 1993

Date: Sun, 19 Sep 93 13:45:44 -0400
From: Calvin Clark <ckclark@MIT.EDU>
To: bert@MIT.EDU
Cc: bugs@MIT.EDU
In-Reply-To: "[11006] in Athena Bugs"

   [11006]  daemon@ATHENA.MIT.EDU (bert@MIT.EDU) Athena Bugs 09/15/93 23:23 (28 lines)
   Subject: decmips 7.6F: session_gate
   From: bert@MIT.EDU
   Date: Wed, 15 Sep 93 23:22:52 EDT

	.	.	.

   What should have happened:
	   It should honor the "#!<shellname>".

	   Ideally, it would do the following:
	     - check if .logout exists
	     - if it starts with "#!" and is executable, just run it as is
	     - if not, get user's default shell (/etc/passwd is probably more
	       reasonable place to look than Hesiod) and run it on the file.

I see a few problems with this solution:

	Most consultants recommend setting the environment variable
$SHELL to effect a change of shell for X logins, and discourage use of
chsh.  Therefore, the shell in /etc/passwd is not necessarily the one
the user wants to use most of the time.

	Also, the .logout file is (historically) a csh file.  No other
program should read it.  The fact that session_gate does is a kludge;
when people used xinit, a common tactic was to start one of the xterms
as a "login" xterm, and the shell is invoked with an argv[0] starting
with `-', which tells csh (and most other shells) that it is a login
shell.  With csh, the .logout file is sourced by the login shell upon
exit.  (This is what happens with Athena tty logins.)  With the Athena X
session environment, however, there is usually no login shell, so
session_gate was made to invoke csh on .logout before exiting.

	Given this context, I think it's wrong to hack things so that
.logout could be something other than a csh script.  If it were named
.end_session or something, and it was simply exec'd by session_gate on
logout the same way .xsession is executed on login, than that would be
okay.  However, if you try to extend the meaning of .logout so that it
might be run in any of a number of ways, you'd just confuse people and
run into inconsistencies.  For example, under your proposed scheme, a
user who actually uses chsh to change his login shell to ksh would
discover that .logout "works" for X sessions but does not work for tty
sessions, because ksh does not source .logout.

	I'm not going to get into the headaches that would be caused by
allowing .logout files in any language, but if you consider the amount
of naive dotfile copying that goes on at Athena, you'll get the picture.

	Csh chauvinism turns up everywhere on Athena, and there's no
easy way to get rid of it without introducing chaos.  Non-csh users are
simply on their own, and that's not a big problem.  Consider my one-line
.logout file :-) 

/bin/sh $HOME/.sh.lo


home help back first fref pref prev next nref lref last post