Forcing actions at login
Alex Martelli
alex at am.sublink.org
Fri Jan 11 06:15:46 AEST 1991
jc at minya.UUCP (John Chambers) writes:
[discussion of using a script as shell for a pseudo-user]
:It turns out to be a bad idea to use /bin/sh as the login shell for
:such a script. Why? Well, /bin/sh insists on running /etc/profile
:for all users; there's no (documented ;-) way to suppress this. If
:your /etc/profile does "cat /etc/motd" (and most do), it is just a
Just kludge up a way to disable motd-checking - simplest scheme I can
think of, offhand, is to add something like:
egrep "^$LOGNAME:.*NOMOTD" /etc/passwd >/dev/null && exit
just before the cat /etc/motd in /etc/profile, then add the NOMOTD
keyword somewhere in the /etc/passwd line of the pseudo-user (e.g. in
the gcos field, or just use it as a part of the filename of the pseudo
shell script for the pseudo-user).
: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!-)
:On the other hand, just a few weeks ago, I ran across a sytem with
:a very clever getty that dumps /etc/motd to the port itself. The
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...
:Why is it that, as commercial Unix systems get more and more "user
:friendly", they get harder and harder to keep working right. Maybe
:we should start hollering about "admin friendly" features.
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.
--
Alex Martelli - (home snailmail:) v. Barontini 27, 40138 Bologna, ITALIA
Email: (work:) staff at cadlab.sublink.org, (home:) alex at am.sublink.org
Phone: (work:) ++39 (51) 371099, (home:) ++39 (51) 250434;
Fax: ++39 (51) 366964 (work only), Fidonet: 332/401.3 (home only).
More information about the Comp.unix.admin
mailing list