Hi
Bettina Stern & Arieh Bibliowicz wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Is there any way I can log my entries and exists from X? I enter and exit my
> computer using a graphical login, so .login and .logout do not work (well,
> maybe .login does, but .logout surely does not). I want to log the time I
> entered the server to the time I exited the server (even explicit kill, e.g,
> Ctr-Alt-Backspace).
I don't know about new graphical logins (KDM, GDM) but if they are
similar enough to xdm they should have scripts that run at logins and
logouts.
In xdm, the script /etc/X11/xdm/Xstartup has these lines:
----------------
# Insert a utmp entry for the session
if grep -qs ^use-sessreg /etc/X11/xdm/xdm.options; then
exec sessreg -a -l $DISPLAY -u /var/run/utmp -x /etc/X11/xdm/Xservers $USER
# NOTREACHED
fi
----------------
and /etc/X11/xdm/Xreset has
----------------
# Remove the utmp entry for the session
if grep -qs ^use-sessreg /etc/X11/xdm/xdm.options; then
sessreg -d -l $DISPLAY -u /var/run/utmp -x /etc/X11/xdm/Xservers $USER
fi
----------------
If you have similar lines in the corresponding files of your login manager
(actually refferd to as 'Display Manager') you only have to add a line with
'use-sessreg' to /etc/X11/xdm/xdm.options (or whatever). Otherwise, just add
the actuall calls to sessreg to those files.
Anyway, when you do this, sessreg adds entries to wtmp, and the usual ways
to access it work (e.g. last(1), getutent(3) ).
BTW, I personally don't let xdm run the XServer, for some technical problems
I had. Instead, I run it separately, from an init.d script, which also logs
it's output to a log file. This also helped me debug some problems (even
though this doesn't log logins and logouts, but XServer starts and crashes).
>
> Thanks,
>
> Arieh
>
>
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
>
didi
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]