As usual this list comes up with the goods - I received the first reply
5 hours before my own message got back to me ;-)
I got my wrist slapped by a couple of people (including the list moderator -
sorry Mr LeFebvre), saying that this question was more appropriate for
an X specific list. In hind sight this is probably true, my only defence
is that it *was* a question about system administration!!
First my original message:
>Subject: New xterm/motd/xdm interface required
> I have been using xdm for a while on workstations and have just got a
>load of xterminals that will also use xdm. However, I have noticed a few
>times that people have missed importantish messages that I've put in motd
>because the default xterm doesn't act like a normal login (which isn't
>surprising as it isn't a login shell!) and display /etc/motd. Another slight
>annoyance is that loging in via xdm doesn't leave a login record in wtmp.
>So, my question is this, does anybody know of
>i) A different xterm that does motd displaying and wtmp loging?
>ii) A different xdm that does wtmp logging
>iii) An X application that will display motd that I can run as part of
> .xsession (there is something like this for NeXT computers that I
> found in the archives, but nothing sensible for generic X).
>I suspect that the combination of (ii) and (iii) would be most sensible.
Taking the questions in order.....
A couple of people suggested that various options to xterm may produce the
desired result: -ls produces a login shell, but still doesn't simulate a
"real" login; +ut does utmp loging, not wtmp loging.
Some suggested using a script that xterm runs when it starts up that cats
/etc/motd to the display.
But, the overwhelming opinion was that this was not the direction to go.
There is a program in the xdm source directory (mit/src/clients/xdm) called
sessreg (if only I had bothered to look). This program appears to do all
the necessary wtmp logging. An example of the comprehensive set of answers
I received comes from Brent Alan Wiese <firstname.lastname@example.org>
> There is a program called sessreg that is in the X11R4 src/client/xdm
>directory. Compile this and run something like ...
> sessreg -a -u none -l xdm -h $DISPLAY $USER || exit 1
>... for a Sun/BSD system in /usr/lib/X11/xdm/Xstartup and ...
> sessreg -d -u none -l xdm -h $DISPLAY $USER || exit 1
>... in /usr/lib/X11/xdm/Xreset. Xterms should already do utmp logging and
>I believe what I have suggested will tell when a person starts a xdm session
>on an xterminal/workstation. This is hopefully alot more useful than logging
>every xterm somebody starts.
Nearly everyone suggested using xmessage (available from your local repository
of goodies). A typical answer came from Stephen Malowany <email@example.com>
>iii) There's a neat little X program called "xmessage" which can display
> the contents of a file (use archie to find the site nearest you),
> so in the Xstartup file for xdm,
> if [ -f /etc/nologin ]; then
> xmessage -file /etc/nologin \
> -buttons Okay -default Okay -geometry +325+50
> exit 1
> if [ -f /etc/motd ]; then
> xmessage -file /etc/motd \
> -buttons Continue -default Continue -geometry +325+50
> This will popup a window containing the motd before starting the
> Xsession. If a nologin exists, this is displayed instead, and the
> Xsession is not run.
However, the overwhelming number of replies suggested the xlogin program
in the X11R5 contribs directory. Here is a part of the README:
> This program was written to do some stuff, which is no longer
>done, when using Xdm from X Windows Version 11 (and not using sessreg).
>It handles /etc/motd, /etc/nologin, user quotas (EPROCLIM, EUSERS),
>/usr/adm/lastlog, /usr/adm/wtmp, /etc/utmp and $USER/.hushlogin.
>For more information see the manual page.
> I tried to write it as secure as possible (range checking in
>strings etc.), but any further security hints are welcome.
Again, I suppose if I had thought about it I could have found this for
myself - that's what comes of doing an afternoon's teaching!!
The roll of honour is:
Peter Kaldis <peter@CA.Concordia.Civil>
Brent Alan Wiese <firstname.lastname@example.org>
email@example.com (William LeFebvre)
firstname.lastname@example.org (Jim Davidson)
email@example.com (Sandi Donno)
Kevin Cosgrove <firstname.lastname@example.org>
email@example.com (Ian MacPhedran)
firstname.lastname@example.org (Kevin McElearney)
Stephen Malowany <email@example.com>
Steve Seaney <firstname.lastname@example.org>
email@example.com (Hanh Vu - xt 2801 )
firstname.lastname@example.org (Greg Jumper)
Andy Stevens <email@example.com>
Seth Robertson <firstname.lastname@example.org>
Kayvan Sylvan <kayvan@COM.Sylvan.satyr>
email@example.com (Ivan Dean)
firstname.lastname@example.org (Matthew Donaldson)
Clive Newall <clive@AU.EDU.unimelb.asis>
Scott Fritchie <email@example.com>
firstname.lastname@example.org (Birger A. Wathne)
Many thanks to all the above for the many helpful comments, programs, scripts
and so on. If anyone wants the full set of replies, send me a message and
I'll gladly send you them.
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:43 CDT