[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: X Background

[Sorry if you get this twice]

*-Michael Beattie <mickyb@es.co.nz>
| On Tue, 8 Sep 1998, Hamish Moffatt wrote:
| > On Sat, Sep 05, 1998 at 04:33:53PM -0500, D. W. Wieboldt wrote:
| > > xsetroot -solid [color] &  is just fine for one color.  For a little
| > 
| > xsetroot runs and terminates; no need for the & as far as I can tell.
| Isn't that an .xsession issue though? I had the impression that the first
| foreground process was to be taken as the "windowmanager" (I cant think of
| a better word... windowmanager as an equivalent (controlling process?)),
| and when it exits, so does the X session. I am probably wrong, but there
| is only one way to learn!

The X session exits when the entire script/program .xsession exits.

A couple of examples:


This will start emacs in the background, start xterm in background
and finally start fvwm. Fvwm is started in the foreground, which means
that the script will "hang" there until fvwm dies. When it does the script
continues, sees that there is nothing more and dies. Only then will the
X session terminate.

xsetroot -solid black
wait $!

First xsetroot is run. The script will wait until it has finished.
that shouldn't take long time and afterwards it continues to put
xemacs and kvt in the background. Then icewm is run in the
background. Weird, shouldn't we wait for that. Oh yes, we finish
with wait $!. $! is the PID of the last process started in the
background and wait just stands there, waiting for the process
given as argument to finish. Therefore this .xsession will also
wait for the windowmanager to finish. Then it will go on
to execute a program called run_my_logout_cleaner. This will supposedly
do something clever and when it's finished it will return. When
it has done so, the script has come to an end, thereby terminating
our X session.


Reply to: