[comp.windows.x] Killing applications

KATZ@VENERA.ISI.EDU (Alan R. Katz) (08/19/87)

I am running X on a Sun, using the uwm window manager.  Can anyone tell
me how to provide a menu item which does an "Exit"??  I want a way of
notifying the controlling process of an X-window to die. 

I would also like a Root-menu item to Exit X-windows (currently, I type
exit to the initial xterm window).

				Alan

-------

raveling@VAXA.ISI.EDU (Paul Raveling) (08/19/87)

Regarding...

	I would also like a Root-menu item to Exit X-windows (currently, I type
	exit to the initial xterm window).

After groping around a bit, I arrived at one workable way to do this.
on HP 9000's.  It seems reasonable it should also work on a Sun, but
I make no claims and have little faith in different Un*x systems being
REALLY compatible.


This technique works when xinit starts X with an initial terminal window.
In .uwmrc, each menu has an "Exit from X" entry, looking like this:

	menu = "Display Operations" (Yellow:Blue:White:Red) {
	... other menu entries ...
	Exit from X:            !"exitx"
	}


The exitx shell script contains:

	#
	#	exitx:	  Shell file to exit from X
	#
	ps -e | awk '/console/&&/xterm/{print "kill " $1}' | csh


The main difficulty I had was in trying to specify the shell script's
one-liner directly as the menu operand.  I never found a successful
combination of quotes and escapes to get the correct command delivered
to a shell.


--  Paul Raveling
    Raveling@vaxa.isi.edu

dgreen@CS.UCLA.EDU (Dan Greening) (08/19/87)

> Regarding...

> 	I would also like a Root-menu item to Exit X-windows (currently, I type
> 	exit to the initial xterm window).

> After groping around a bit, I arrived at one workable way to do this.
> on HP 9000's.  It seems reasonable it should also work on a Sun, but
> I make no claims and have little faith in different Un*x systems being
> REALLY compatible.

-------------

Better way on HP-UX, with an HP 9000:
        ...
 	Exit from X:       !"kfork xterm uwm xclock xload xps xdvi xrload X"
 	}

This will NOT work on any other operating system.

--------------

Which brings us to a more important point:  There should be a program which
kills all clients to a particular server, revoking all host permissions, and
reclaiming all resources.

This can be done by killing the server and restarting it, but some client 
programs on other machines seem to continue running after this exercise.
At least this is true with our systems (clients on a sun, server on an
HP 9000).

In any event, KILLING the server seems awfully drastic.  Does anyone have a
program to do this?


Dan Greening   Internet   dgreen@CS.UCLA.EDU
               UUCP       ..!{sdcrdcf,ihnp4,trwspp,ucbvax}!ucla-cs!dgreen