How to restart X

Nifty Hat Mitch mitch48 at sbcglobal.net
Tue Jul 27 17:51:17 UTC 2004


On Mon, Jul 26, 2004 at 10:23:33AM -0500, Erik Volkman wrote:
> Reply-To: For users of Fedora Core releases <fedora-list at redhat.com>
> 

> I feel really silly asking how to do this, but I can't figure out
> the Redhat/Fedora way of doing this. In debian if I want to restart
> X from the console I can do a /etc/init.d/(x|k|g|w)dm
> restart. What's the equivalent in Redhat/Fedora? I'm not seeing
> anything in /etc/init.d or in service --status-all that appears to
> be what I want, and doing an init 3; init 5, seems like overkill.

Yes the pair of  init 3; init 5 is overkill.

If you look at the set of /etc/inittab lines that have both
init 3 and init 5 in them you will see a longer list of 
things than just X. So changing initstate is overkill as
you noted.

What you are looking for is the specific lines and processes that sets
run level 3 apart from run level 5.  Looking at:

    diff -d /etc/rc.d/rc5.d/ /etc/rc.d/rc3.d/ 

and the contents of inittab I only see one critical line
in inittab.

   # Run xdm in runlevel 5
   x:5:respawn:/etc/X11/prefdm -nodaemon

Since this line is marked "respawn" all you need to do is kill the
active window manager parent process so that init notices and restarts
the window manager.

The /etc/X11/prefdm  script and the scripts and binaries it
plays with are worth looking at.

So scan /etc/X11/prefdm, note that it can start one of three window
managers.  Look for the one of the three window managers and kill it.  I
would prefer to kill the primary process but a dull killall approach
should also work. If you have only one window manager, something like
this:

    First look...
	      ps -efl | egrep "kdm|gdm|xdm"

    Now you can terminate the process (see also kill).
	      killall kdm gdm xdm

    And check the result...
	      ps -efl | egrep "kdm|gdm|xdm"

A control-alt-backspace kills the current window manager unless 
that key sequence trap is turned off.  That however depends on X.
If X is well enough to do this then why are we killing X.

I doubt that xfs needs restarting.  Still, the X-font server (xfs)
might need some attention as X depends on it.

In some cases there could be a hardware driver lockup/ or other driver
issue that this might not clear up.


-- 
	T o m  M i t c h e l l 
	/dev/dull where insight begins.





More information about the fedora-list mailing list