Forcing actions at login

John Chambers jc at minya.UUCP
Mon Jan 14 04:23:09 AEST 1991


> :One nice thing about csh is that it doesn't have such a mandatory
> :global startup file.  It only runs $HOME/.login and/or $HOME/.cshrc;
> 
> Fancy that, I'd count this as one NASTY thing about csh!-)

Not really.  The benefit to making .login and .logout local to each
user's home directory, and using no global files at all, is that you
can give each new user a default version that does nice things like
"cat /etc/motd" and "mail -e" and so on, but they can be emptied or
deleted for users that need (or want) other behavior.  It's true that
using a single global file is an initial convenience for administrators, 
but only until they stumble across the problems it causes with packages
that use pseudo-users for some purpose.  Then the convenience evaporates.

It's a bit of a task initially, but it's not hard to write a little
program that generates the names of the .login files of all "real"
users, and feeds this list to a for loop that appends a new line.
In my experience, users don't often complain about the admin doing
such a thing, at least if the new action is generally useful, and
they can delete it if they're unhappy.

> One day I'll tell you about the getty which catted /etc/issue, which
> contained something about "AT&T" which the somewhat-Hayes-compatible
> modem took as a request to ENTER SELF-TEST-MODE... 

No, don't tell me about it; I can easily imagine the fun you had!

> On this general subject, I can agree wholeheartedly.  I particularly
> detest such useless feechures as automatical sourcing of .logout on
> shell termination, when trapping on a 0 signal (to . .logout, or to
> whatever one wants) is so clearly right!  They pander to semieducated
> users, and semieducated system administrators, and meanwhile make it
> all more complex for all of us.

Actually, I've found the .logout to be a minor convenience.  You don't 
have to use it, and it's a cleaner way of dealing with closing actions 
(like forcing a modem to hang up) than surrounding the program with yet 
another background shell that sits there idle, using system resources. 
It's conceptually much easier to use (and debug) than the Bourne shell's 
trap feature.  And I've never made any sense at all of the C-shell's way
of dealing with signals.  (I mean, I've read TFM, but it doesn't do what
I want it to; I guess I'm just an idiot, so I'l use the thing that idiots
like me can understand. ;-)

-- 
All opinions Copyright (c) 1991 by John Chambers.  Inquire for licensing at:
Home: 1-617-484-6393 
Work: 1-508-486-5475
Uucp: ...!{bu.edu,harvard.edu,ima.com,eddie.mit.edu,ora.com}!minya!jc 



More information about the Comp.unix.admin mailing list