[comp.windows.x] Killing X Softly?

amir@taux01.nsc.com (Amir J. Katz (Xpert)) (04/29/91)

- I start X11R4 on my Sun SparcStation IPC (w/SunOS 4.1.1) with xinit. 

- My .xinitrc is a Bourne shell script. It opens various xterm windows, fires up the
  window manager, then waits until the first xterm window dies (typing 'exit' in that
  xterm is enough). When this happens, the script kills some stubborn X clients and then
  exits. Below are the relevant parts:

    xterm -C -ut -geom 102x7+8+80 -fn 8x13bold & loginscreen=$!
    xterm    -ut -geom 113x44+5-5 -bg LightBlue -fg black &
    xperfmon user system disk -u 5 -fw -fn 6x10 \=300x100+846+5 & xper_pid=$! 
    twm & twm_pid=$!
    ...
    wait $loginscreen; kill -9 $twm_pid $xper_pid

- Trouble is, when X dies in this manner, I get all kind of ugly messages
  like "XIO error", "Fatal X error", etc. which trash the console window.
  Nothing bad really happens, but being a methodical guy, I hate this method.

- I've noticed that under OSF/Motif's mwm, the 'close' menu item kills a client nicely,
  versus twm's function f.kill which results in similarly ugly messages.

- The $64,000 question is: is there a nicer way to exit from X? Or alternatively,
  fire it up in a different manner?

- I have used xdm, but I'm afraid it'll monopolize the display and I won't be 
  able to start SunView or OpenLook.

- I apologize in advance if this is a FAQ. Please e-mail to me, using the address
  below. I'll summarize and post.
--
   Amir J. Katz, System Manager

Internet:	amir%pilat.UUCP@taux01.nsc.com OR amir@taux01.nsc.com
UUCP:		{decwrl,uunet,...}!nsc!taux01!amir
Phone:		+972 52-570713
Fax:		+972 52-570719
Snail-mail:	Amir J. Katz, Silvaco Israel Ltd.
		19 Maskit St., Herzelia, Israel 46733

gildea@expo.lcs.mit.EDU (Stephen Gildea) (05/04/91)

      Trouble is, when X dies in this manner, I get all kind of ugly
      messages like "XIO error", "Fatal X error", etc. which trash the
      console window.  Nothing bad really happens, but being a
      methodical guy, I hate this method.

Using xdm is the clean way to start and stop sessions without ugly
messages.  Yes, I know you said you didn't like xdm, but if you like
neatness, xdm is the way to go.

And for killing single clients, twm has a f.delete function, which is
the same "graceful" function as "close" in some other window managers.

 < Stephen
   MIT X Consortium