I am currently running xdm on a Sparc workstation running 4.1.3 and need
some ideas/solutions for updating the wtmp file for console logons. Any
help will be greatly appreciated. Thanks in advance.
Bill
Bill
We have been using xlogin version 2.01 by Markus Stumpf at
/usr/adm/wtmp, /usr/adm/lastlog, /etc/utmp and /etc/nologin
files. We aren't using xdm to manage the consoles so I can
not confirm that this will work in your case. Also, the
README file makes no mention of processing the /etc/fbtab.
John Van Bockel
Martin Marietta Services, Inc.
--Quote:>I am currently running xdm on a Sparc workstation running 4.1.3 and need
>some ideas/solutions for updating the wtmp file for console logons. Any
>help will be greatly appreciated. Thanks in advance.
Jeff Holmbeck Control Data Systems, Inc.
(612)482-3255 4201 Lexington Avenue North
fax: (612)482-2791 Arden Hills, MN 55126
-----------------------------------------------------------
|> You might want to check out the descriptions of Xstartup and Xreset in
|> the xdm(1M) man page. Xstartup is a script that is run as root after
|> the user's login is validated but before the user's session is started.
|> Xreset is a script that is run as root after the user's session is
|> terminated. You can call a program that updates the wtmp file from
|> those scripts. I think that you will have to "roll your own" wtmp
|> updated program, however.
|>
There's a program called "sessreg" (which I think is contained in
X11R5) which does just this. You may find that it needs a little rejigging
to work with X-terminals which XDMCP though, since it tries to use the
Xservers file to calculate a slot number for utmp/wtmp.
--
+--------------------------+-----------------------------------------------
| Philip J. Naylor | Truth is Beauty, but Beauty is in the eye of |
+--------------------------^-----------------------------------------------
| http://gate.uwe.ac.uk:8000/cgi-bin/staffquery?philip+naylor |
+--------------------------------------------------------------------------
on that subject...does anyone have such a program that works?
I have tried using 'sessreg' on solaris 2.3, and it works great
for the first user that logs in, but the next one overrites that one.
(ie, utmp shows only one person logged in, when there might be many).
kevin
--
WWW -> http://rever.nmsu.edu/~bob/
RUSH sage - RUSH judan.
Although the manual page says you should let it use utmp logging, don't.Quote:> on that subject...does anyone have such a program that works?
> I have tried using 'sessreg' on solaris 2.3, and it works great
> for the first user that logs in, but the next one overrites that one.
> (ie, utmp shows only one person logged in, when there might be many).
But who cares about working utmp logging on Solaris anyway? Sun
certainly does not, or it would work after these n patches for it ... :(
Michael "how can I be 43 days idle with 5 minutes uptime of the beast?"
--
Twiggs and root are a wonderful tree (tm) Twiggs & root 1992 :-)
d? H- s(+)/(-) g! au a- w+ v(---) C++(+++) UL++++S++++$?++++ L++ 3 E-
: Although the manual page says you should let it use utmp logging, don't.
: Since there is no pty associated with xdm, logging the DISPLAY variable
: contents to utmp makes little sense: finger: Can't stat /dev/hostname.dom
: (rest truncated, you get the idea) I would compare it to an ftp login,
: where you also only log to wtmp and not to utmp. xterms should do utmp
: logging, though.
well, for a variety of reasons, the powers that be want utmp
logging. ;(
finger is usually disabled, but they want 'who' and 'w' to show
all the xdm users that are on.
To recap: I am trying to use sessreg in my xdm Xstartup script to
log each user in utmp and wtmp. It appears to work for the first
user, but then the next user that logs in overwrites the first one.
OS: solaris 2.3
X: R5
Line in Xstartup:
sessreg -a -l $DISPLAY $USER
We are using Xdmcp...so all our xterm's are not in the Xservers file,
but the sesreg man page says that doesn't matter.
It also says that in sysv, you don't need to worry about figureing
slots in utmp, but it looks to me like that is the problem. ;(
Any of your X guru's have a solution? (I added comp.windows.x to followups).
: But who cares about working utmp logging on Solaris anyway? Sun
: certainly does not, or it would work after these n patches for it ... :(
: Michael "how can I be 43 days idle with 5 minutes uptime of the beast?"
yeah. Wish they would fix that. It's sometimes quite irritating...
kevin
--
WWW -> http://rever.nmsu.edu/~bob/
RUSH sage - RUSH judan.
I'd hardly stretch to calling myself a X guru, but what I did here
was modify sessreg so that it expected the lines in Xservers to start with
a # - that way both sessreg and the machines using XDMCP are happy. You
have to remember to put in a hashed out line for the console, as well as the
real one though. You also need to have some sort of comment after the (hashed
out) display name, since sessreg ignores lines which don't have two items on
them (i.e. a display name and a startup command).
If anyone wants a copy of the kludged code, let me know.
--
+--------------------------+-----------------------------------------------
| Philip J. Naylor | Truth is Beauty, but Beauty is in the eye of |
+--------------------------^-----------------------------------------------
| http://gate.uwe.ac.uk:8000/cgi-bin/staffquery?philip+naylor |
+--------------------------------------------------------------------------
1. xdm, $DISPLAY, wtmp on Sol 2.3
Hi,
Thanks for the responses to this. I should note that under 4.1.3
it wasn't quite the same setup, and I indeed never had trouble then.
Now, thanks to one of the kind respondees, here is what worked for
getting the proper DISPLAY variable, and then getting logged with wtmp.
This assumes that there is at least one person in the same boat, though
I'm sure many of the more knowledgeable managers would have figured this
out already.
I needed to do a few things.
First I had to learn about /usr/openwin/sessreg.
Following the man page, I made up Xstartup and and Xreset files.
Then I also changed the DisplayManager._0.authorize resource to
true. I would have thought this obvious, but on SUNOS 4.1, I had
it 'false'.
Here is the xdm-config file - I added the last two lines as well.
/usr/local/lib/X11/xdm> more xdm-config
DisplayManager.errorLogFile: /var/adm/xdm-errors
DisplayManager.pidFile: /var/adm/xdm-pid
DisplayManager.keyFile: /var/adm/xdm-keys
DisplayManager.servers: /usr/local/lib/X11/xdm/Xservers
DisplayManager.accessFile: /usr/local/lib/X11/xdm/Xaccess
DisplayManager._0.authorize: true
#DisplayManager._0.setup: /usr/local/lib/X11/xdm/Xsetup_0
DisplayManager*startup: /usr/local/lib/X11/xdm/Xstartup
DisplayManager*reset: /usr/local/lib/X11/xdm/Xreset
DisplayManager*resources: /usr/local/lib/X11/xdm/Xresources
DisplayManager*session: /usr/local/lib/X11/xdm/Xsession
DisplayManager*authComplain: false
DisplayManager*daemonMode: true
DisplayManager*removeDomainname: false
This last line is what had been screwing up the DISPLAY variable.
You see, if just left to its own devices (no pun intended) the Xsession
file used to give DISPLAY as something like avocet:0.0. ANd of course,
I could never get that script from Sun to work (the one you and I stepped
through a while ago).
The Xstartup file is
#!/bin/sh
#
# Xstartup
#
# This program is run as root after the user is verified
#
#/etc/xdm/printenv >> log.environ
#/usr/bin/tty >> log.environ
#/etc/xdm/wtmp_update $USER login $DISPLAY
/usr/openwin/bin/sessreg -a -l $DISPLAY -x /usr/local/lib/X11/xdm/Xservers
$USER
while Xreset is;
#!/bin/sh
#
# Xreset
#
# This program is run at the end of a session
#
#/etc/xdm/printenv >> log.environ
#/usr/bin/tty >> log.environ
#/etc/xdm/wtmp_update $USER login $DISPLAY
/usr/openwin/bin/sessreg -d -l $DISPLAY -x /usr/local/lib/X11/xdm/Xservers
$USER
and now, the Xservers file is empty, whereas I used to list all of the
xterms.
pheeew.
Henry
2. The *real* state of the art.
5. sessreg/xdm wtmp problem, Solaris 2.3
10. Mysterious wtmp entries from xdm (kdm) logins
11. xdm and sessreg: wtmp/utmp
12. no entries in wtmp after running xdm
13. xterm settings in xdm for utmp/wtmp logging..