X-WINDOWS EXIT AND LOGIN/LOGOUT
ITEM: RTA000028044
QUESTION:
My customer would like to be able to execute a complete logout from
a user's X-windows session with the following conditions:
1. Must track user login/logout time
2. Use mwm "quit" pop-up to completely exit and logout from X
I have read other Q&A items that touch upon this subject but do
not address my customer's requirement. "exec open xinit" spawns
a child processes that don't really track login and logout. Am I missing
something?
Could using XDM to drive the system console correct this problem?
Do I have any other alternatives to address the basic request?
---------- ---------- ---------- --------- ---------- ----------
A: I do have a simple solution to your customer's requirements as I
understand them. You question leads me to assume that your
customer wants to know when an individual user starts Xwindows
and when this individual stops Xwindows. Your customer also
wants individuals to completely exit out of Xwindows simply by
selecting "Quit" from the Motif menu button.
To track user login/logout time, you must modify the
/usr/bin/X11/xinit script. You should place a timestamp
at the beginning and end of the script. Since the script
waits for Xwindows to finish before it finishes execution,
the second timestamp will only occur when the user exits
Xwindows.
FIRST TIMESTAMP
The first timestamp should be the first non-commented line of the
script. This location on my system (AIX 3.2) was at line 42.
At this point you should add the following line. Please note:
since some characters do not pass over the network properly, I have
included the following translations:
= backtick (the key to the left of the 1)
echo $USER started Xwindows at date >> account_file
"account_file" is the file (with full pathname) that will record
the timestamp information. It should be in a location that is not
readily accessible by most users and should have permissions of
722 so it can only be read by its owner or root.
SECOND TIMESTAMP
The second timestamp should be placed at the end of xinit file.
The following should be the last line of the xinit file:
echo $USER exited Xwindows at date >> account_file
When user 'joe' starts Xwindows at 9 AM and exits Xwindows at
9:30 AM, the account_file will show (for example):
joe started Xwindows at Wed Dec 02 09:00:00 1992
joe exited Xwindows at Wed Dec 02 09:30:00 1992
To have Xwindows completely quit when the motif "quit" button is
pressed, it should be started with the "open xinit" command. This
can be abstracted further by creating a shell script to provide
this function. If, for example, you were to create a shell script
named "runX" which contained only the following line:
open xinit
you could have your customer's users always start Xwindows by using
the runX command. This would make the open xinit process transparent
to the users. To use "runX" you would have to "chmod +x runX" and
place "runX" in a directory whose path was common to all users
(ex. /bin).
This response assumes that you customer's users are starting
Xwindows from the command line and should return to the command line
once Xwindows is finished. If this assumption is not correct, please
respond back with the method by which Xwindows is starting.
---------- ---------- ---------- --------- ---------- ----------
This item was created from library item Q614367 BWZPX
Additional search words:
ACCOUNTING AIXWINDOWS BWZPX ENVIRONMENT EXIT IX JAN93 LOGIN LOGOUT
OZNEW REQUIREMENT RISCSYSTEM RISCXWIN SOFTWARE TIMESTAMP X-WINDOWS
XWINDOWS
WWQA: ITEM: RTA000028044 ITEM: RTA000028044
Dated: 11/1996 Category: RISCXWIN
This HTML file was generated 99/06/24~12:43:10
Comments or suggestions?
Contact us