How to restart X Windows System for new desktop `Xfce' to take effect

9k views Asked by At

I installed Fedora 20 a while ago and now decided to install and test Xfce ui. I installed Desktop Switched gui utility for switching the ui. Now when I select xfce in the switcher utility and click apply I get the following message.

Your desktop configuration has successfully been updated, but you must restart the X Window System for the changes to take effect.

I then restart my system by doing a shutdown however my old ui (which I believe is gnome) still shows up. How do I restart the Xwindows system ?

1

There are 1 answers

11
Jeff Sheffield On BEST ANSWER

So as I mentioned in the comments I was unable to reproduce your issue. Here is what I did.

  1. a fresh install of Fedora-Live-Desktop-i686-20-1.iso. I created a user during this process.
  2. then updated it with $ sudo yum groups install "Xfce Desktop".
  3. Then I rebooted

When I got the gdm screen. I was able to click on the little gear icon and select Xfce, and everything worked like a top.

Update ( what fixed the issue ):

MistyD > No I changed the start up from session manager during logging on. The next time I restarted my system my old session option was preselected

So now what? Well in the the spirit of:

teach a man/woman to fish you feed him for a lifetime

Note: This the techniques below are non-vendor specific linux configuration advice.

In general when experience window manager configuration issues like this one: and you have two machines: and one works [ workie-box ] and once does not [ no-workie-box ].

I will go through the following debugging process:

  1. Package installation differences
  2. Package Configuration differences
  3. User configuration differences

1: Package installation differences

this situation can arise for a myriad of reasons, however the most common one is the package updates. ( in this case the yum groupinstall ) occurred at different times or while pointed to different package repositories.

$ ssh root@no-workie-box
$ rpm -qa |sort > all_packages_no_workie_box.txt

Now collect the same information on the workie-box

$ ssh root@workie-box
$ rpm -qa |sort > all_packages_workie.txt

Finally copy those two text files to a different machine and diff them. This little technique has saved my bacon many many times.

To round out this topic: what if someone touched something within the package ... how can I know that? With rpm's verify command.

$ rpm -qV gdm

This can also be a super helpful technique.

2. Package Configuration differences

For your issue specifically this is tricky because you have to first choose a display managers. There are several: for example: cdm, tdm, gdm, kdm, lightdm, lxdm, mdm, xdm, SLiM, etc. Mix in with that the fact that different distros package them up and this can turn into the Wild-Wild-West pretty quickly. However here are some helpful rpm specifics

$ rpm -ql gdm |grep bin
  /usr/bin/gdm-screenshot
  /usr/bin/gdmflexiserver
  /usr/sbin/gdm

$ rpm -qcf /usr/sbin/gdm
  /etc/gdm/Init/Default
  /etc/gdm/PostLogin/Default.sample 
  /etc/gdm/PostSession/Default
  /etc/gdm/PreSession/Default
  /etc/gdm/custom.conf
  /etc/pam.d/gdm-autologin
  /etc/pam.d/gdm-fingerprint
  /etc/pam.d/gdm-password
  /etc/pam.d/gdm-pin
  /etc/pam.d/gdm-smartcard

You now know the pond you are fishing in, and alto of times that is enough to catch some fish. Combine that knowledge with the little tidbit I pointed out in section 1:

$ rpm -qV gdm

and this will put you on-top of anyone else configuration attempts. ( including yours that you forgot about )

3. User configuration differences

This little technique has saved my bacon numerous times while un-spooling some window manager that is not working properly. So here is the deal, linux stands on the shoulders of unix's multi user environment heritage. Because of tenet's of unix in general related to user configuration, linux will store all sorts of configuration information in your home directory. This can become extremely problamatic on an update. As most package upgrade systems will leave your configuration un-touched. I.E. They treat you as the expert... they assume you know what you are doing.. so the packagemanager wont touch user configurations.

# Logged in as a user
$ ls -a1 |grep ^\\.
  .
  ..
  .bash_history
  .bash_logout
  .bash_profile
  .bashrc
  .cache
  .color
  .config
  .esd_auth
  .gnupg
  .ICEauthority
  .local
  .mozilla
  .ssh

Look at all of those dot files and directories... Note: there could be plenty more.

Over the years I have used a few techniques to deal with this issue. However my new favorite one is to create a new user from scratch.

Reboot ( - cringe - )

Then log in as that new user. More often than not that will fix the issue. You know that the problem is something to do with your previous user's configuration.

Finally:

The last part of your question was related to restarting X, to re-read in your configuration. Note: I put a reboot -- cringe -- in the previous section. You will find that salty sys admins take great pride in the fact that they dont reboot there linux machines. This is usually because they deal with servers all the time. I would go a step further and ask why you are running a gui on your server. But alas for the nerdy....

Here is how to re-start an X window session without rebooting.

Ok so the deal is that most likely the window manager, and thus the X session was started by a display-manager. Therefore when you log out of your window manager you are still running X. To force a restart... So here is what you do... Kill all of the display-manager && X processes. They will re-fire.. and re-read in your X configuration.

1: ctrl alt F2 This will take you to a terminal.

2: $ ps -efw observe the processes, you are looking for X processes

3: $ ps -efw |grep X these are your X server processes. You also need to find your desktop manager processes. ( you could have several different ones )

4: $ ps -efw |grep kdm $ ps -efw |grep gdm

Now: kill all of the X processes and the display manager processes.

5: $ kill -9 #<pid1> #<pid2> #<pid3> #<pid4>

Note: The system will be configured to restart those DISAPLY manager processes, thus restarting X and re-reading in your configuration.

Or you could just reboot -- grin --