[comp.windows.x] Automatic logoff from X

rls@eatdust.uswest.COM (05/20/89)

From: rls@eatdust.uswest.COM ()


I am designing an application which must be portable across
a number of UNIX machines, and which might also be run
from an X-terminal.

I would like to put an "exit" option on the window mgr
menu which would not only exit the user from X, but also
log them out of UNIX.

Not all window managers have implemented an exit option.

On an HP machine, I was able to do an "exec x11start" in
my .profile,  which Logged me off when I hit CTRL-SHIFT-RESET.
However, I would like this done under program control.

WHile in an xterm window, 
I tried to send a kill -9 to the login shell,  which
logged me off, but the window manager wouldn't die.  
I can kill the window manager, but that doesn't
log me off. ( If I could find the
right pid to kill, I could do it in a program ).

ANy ideas,  also on how to deal with the fact that
on an X-terminal,  the  application would be
running on a different machine than the X-server.

If possible, I would like to avoid doing a "ps"
type command since they are not portable across
machines.  


Path: eatdust!rls
Newsgroups: comp.windows.x
Subject: Automatic logout while in X
Expires: 
References: 
Sender: 
Reply-To: rls@eatdust.uswest.COM ()
Followup-To: 
Distribution: usa
Organization: U S WEST Advanced Technologies
Keywords: 

gsg0384@uxa.cso.uiuc.edu (05/24/89)

>From: rls@eatdust.uswest.COM ()


>I would like to put an "exit" option on the window mgr
>menu which would not only exit the user from X, but also
>log them out of UNIX.

>Not all window managers have implemented an exit option.

>On an HP machine, I was able to do an "exec x11start" in
>my .profile,  which Logged me off when I hit CTRL-SHIFT-RESET.
>However, I would like this done under program control.

Well, I am not sure I understand your request. The simplest thing to do is 
to put

alias X 'xstart;logout'

in '.cshrc' if you are running Csh.  The next simplest thing
is write a shell script that does the same thing as you did on your
HP machines.

          Hugh
          gsg0384@uxa.cso.uiuc.edu

benji@hpfcdq.HP.COM (Jeff Benjamin) (05/26/89)

> >I would like to put an "exit" option on the window mgr
> >menu which would not only exit the user from X, but also
> >log them out of UNIX.
> 
> Well, I am not sure I understand your request. The simplest thing to do is 
> to put
> 
> alias X 'xstart;logout'
> 
> in '.cshrc' if you are running Csh.  The next simplest thing
> is write a shell script that does the same thing as you did on your
> HP machines.

Uh...I wouldn't make an alias of "X".  That's your server.

Use something else that isn't alreay a command.

-----
Jeff Benjamin                         {ucbvax,hplabs}!hpfcla!benji
Graphics Technology Division          benji%hpfcla@hplabs.HP.COM
Hewlett Packard Co.                   Fort Collins, Colorado	

wastebasket@LARRY.MCRCIM.MCGILL.EDU (05/28/89)

>>> I would like to put an "exit" option on the window mgr menu which
>>> would not only exit the user from X, but also log them out of UNIX.

Not possible, in general - if the user runs xinit explicitly, you don't
really have any way to log them off.  And suppose the wm isn't running
on the same machine as the X server?  How do you tell?

>> [someone suggests]
>> alias X 'xstart;logout'

> Uh...I wouldn't make an alias of "X".  That's your server.

That doesn't hurt anything.  Users don't run the server from their
shells directly (at least one would hope not), and programs like xinit
that try to exec() the server don't see shell aliases.  The only
potential problem is confusing someone, and presumably someone who's
trying to run the server directly already knows enough not to get
confused.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

	(Use the signature address for mail, not the header address.)

bob@tinman.cis.ohio-state.edu (Bob Sutterfield) (06/15/89)

In article <127300001@uxa.cso.uiuc.edu> gsg0384@uxa.cso.uiuc.edu writes:

      From: rls@eatdust.uswest.COM ()

      I would like to put an "exit" option on the window mgr
      menu which would not only exit the user from X, but also
      log them out of UNIX.

      Not all window managers have implemented an exit option.

   The simplest thing to do is to "alias X 'xstart;logout'"

It wouldn't quite provide an automatic (that is, timeout-driven)
logout from X, but how about a line like

	exec xinit /usr/local/bin/X11/awm -e $HOME/.X11init

in .login (or .profile), then a menu entry like

	"Log out":	f.exit

in .awmrc?  awm is among those that have implemented an exit option,
and if awm is xinit's "blessed client" and it exits, your whole server
will be shut down.  If xinit replaced the login shell, then the user
will be logged out.

tom@ICASE.EDU (Tom Crockett) (06/15/89)

> *Excerpts from xpert: 14-Jun-89 Re: Automatic logoff from X Bob*
> *Sutterfield@ohio-sta (851)*

> It wouldn't quite provide an automatic (that is, timeout-driven)
> logout from X, but how about a line like

>       exec xinit /usr/local/bin/X11/awm -e $HOME/.X11init

> in .login (or .profile), then a menu entry like

>       "Log out":      f.exit

> in .awmrc?  awm is among those that have implemented an exit option,
> and if awm is xinit's "blessed client" and it exits, your whole server
> will be shut down.  If xinit replaced the login shell, then the user
> will be logged out.

I'm using exactly this strategy with awm and it works pretty well.  The only
problem I had was that several of the clients that I start up write to
/dev/console before my console client gets fired up (even though I start it
first), so I had to route output from a few things to /dev/null to avoid
garbaging up the screen.


Tom Crockett

ICASE
Institute for Computer Applications in Science and Engineering

M.S. 132C                               e-mail:  tom@icase.edu
NASA Langley Research Center            phone:  (804) 864-2182
Hampton,  VA  23665-5225