3

I'm using debian testing OS and openbox WM. Moreover, I start X-server via the .xinitrc file, which has the following content:

xrdb /home/morfik/.Xresources
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-session

I notices bunch of errors while rebooting my system. All of them were logged into the file .xsession-errors.old. I added

if [[ $(tty) = /dev/tty4 ]]; then
    mv ~/.xsession-errors ~/.xsession-errors.old
    exec startx &> ~/.xsession-errors
fi

and that's why I have the .xsession-errors and .xsession-errors.old files and can read theirs content. For instance, the essential part of the file looks like this:

xinit: connection to X server lost

waiting for X server to shut down urxvt: X connection to ':0' broken, unable to recover, exiting.
XIO:  fatal IO error 4 (Interrupted system call) on X server ":0"
      after 5353 requests (5353 known processed) with 0 events remaining.
real transparency on... depth: 32
xRandr: Found crtc's: 2
xRandr: Linking output DVI-I-2 with crtc 0
NO XSETTINGS manager, tint2 use config 'launcher_icon_theme'.
XIO:  fatal IO error 4 (Interrupted system call) on X server ":0"
      after 13565 requests (13565 known processed) with 0 events remaining.
real transparency on... depth: 32
xRandr: Found crtc's: 2
xRandr: Linking output DVI-I-2 with crtc 0

(kglobalaccel:1707): GConf-WARNING **: Got Disconnected from DBus.

firefox: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
kdeinit4: Fatal IO error: client killed
kglobalaccel: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
xscreensaver: 11:27:38: SIGHUP received: restarting...
xscreensaver: 11:27:38: running as morfik/morfik (1000/1000)

klauncher: Exiting on signal 15
kdeinit4: Fatal IO error: client killed
kdeinit4: kded4 [kdeinit]: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.
.Terminated
.claws-mail: Fatal IO error 2 (No such file or directory) on X server :0.
xscreensaver: 11:27:41: Can't open display: :0
xscreensaver: 11:27:41: running as morfik/morfik (1000/1000)

xscreensaver: 11:27:41: Errors at startup are usually authorization problems.
              But you're not logging in as root (good!) so something
              else must be wrong.  Did you read the manual and the FAQ?

              http://www.jwz.org/xscreensaver/faq.html
              http://www.jwz.org/xscreensaver/man.html

.(EE) Server terminated successfully (0). Closing log file.
(EE) 
(EE) Backtrace:
(EE) 0: /usr/bin/X (xorg_backtrace+0x48) [0x7fc1bbd38c58]
(EE) 1: /usr/bin/X (0x7fc1bbb91000+0x1ab949) [0x7fc1bbd3c949]
(EE) 2: /lib/x86_64-linux-gnu/libpthread.so.0 (0x7fc1ba913000+0xf210) [0x7fc1ba922210]
(EE) 3: /lib/x86_64-linux-gnu/libc.so.6 (malloc_usable_size+0x26) [0x7fc1b93d1d36]
(EE) 4: /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x7fc1bab2f000+0xab6f3) [0x7fc1babda6f3]
(EE) 
(EE) Segmentation fault at address 0x0
(EE) 
Fatal server error:
(EE) Caught signal 11 (Segmentation fault). Server aborting
(EE) 
(EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE)

I'm getting this kind of message every time I type openbox --exit in a terminal. I found some similar topics on the subject, and people were saying that the errors appear because of SIGTERM signal which was sent to X-server, and all the other applications just can't connect to it anymore, so they crash.

How to solve this issue? How to close all the GUI apps before X-server will be terminated?

UPDATE#1

I tried the aecolley's solution, but unfortunately I couldn't even start the graphical environment -- it just hanged, no errors in the /var/log/Xorg.0.log or .xsession-errors files. I could restart X-server via ctrl+alt+del, but I just had a black screen, and that's all.

The other thing with the solution is that it installs many dependencies. In order to have openbox-gnome-session, I had to install the packages: openbox-gnome-session , gnome-settings-daemon , packagekit , libpam-systemd. And they install this stuff:

# aptitude install openbox-gnome-session gnome-settings-daemon packagekit libpam-systemd
The following NEW packages will be installed:
  gdebi-core{a} gnome-desktop3-data{a} gnome-session-bin{a} gnome-settings-daemon libelfg0{a} libglib2.0-bin{a} libglib2.0-data{a}
  libgnome-desktop-3-7{a} libibus-1.0-5{a} libimobiledevice4{a} libjson-glib-1.0-0{a} libjson-glib-1.0-common{a} libpackagekit-glib2-16{a}
  libpam-systemd libplist1{a} libupower-glib1{a} libusbmuxd2{a} libwacom-common{a} libwacom2{a} nautilus-data{a} openbox-gnome-session
  packagekit packagekit-backend-aptcc{a} python3-dbus{a} python3-packagekit{a} systemd{a} upower{a} usbmuxd{a}
The following packages are RECOMMENDED but will NOT be installed:
  nautilus packagekit-tools
0 packages upgraded, 28 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/12.7 MB of archives. After unpacking 52.6 MB will be used.
Do you want to continue? [Y/n/?]

I installed it and added:

exec ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-gnome-session

or

exec openbox-gnome-session

to the .xinitrc file.

Even if the solution worked, I wouldn't do this to my system. :) There's got to be another way to fix this.

2

I think I finally have found the cause of this problem. It looks like there's a problem with nvidia drivers and xorg. I tried to install a fresh system only from the main repository, and I checked if the Segmentation fault will appear in the log file -- it didn't. So, I installed then nvidia drivers, and the problem came back.

I think most of the errors from other applications are connected to this segmentation fault, and that's why some apps can't simply save settings/data when xserver crashes.

I'm not sure if this concerns all of the versions of nvidia drivers, but I'm sure this is the case of nvidia-legacy-304xx-driver. That sucks because I have to use the nvidia drivers, and I have no idea how to fix the problem. Maybe the wayland will solve this, so I think I have nothing to do but waiting...

1

openbox-session is not a real session manager. If you have GNOME installed, see the GDM/Openbox instructions; you can use the gnome-session-quit command to end the session. If you have KDE, there's a similar approach for selecting openbox at X login time.

In a more lightweight system (startx or xdm), there are two traditional approaches:

  1. Ignore the errors. Let the X server die and let the X clients cope with it. Some programs don't shut down as cleanly as you'd like, but the consequences aren't disastrous. Unsaved editor buffers can usually be recovered just as if the system lost power.
  2. Use a session manager such as xsm (from x-session-utils) and run the window manager and all other apps under it. This is a little cleaner because it gives applications more chance to interact with the user before shutdown. It requires a little more setup (described below).

In the case of xsm, you can set it up by editing these files:

  • ~/.xsmstartup to insert the single line

    openbox-session

  • ~/.xsession to ensure that the last thing run is xsm (and not openbox).

The .xsmstartup file is used only on xsm's first run to populate the first session. Afterwards, xsm uses its own records to save and restart sessions.

There is a small dialog controlling xsm, but you can force it to begin a shutdown from the command line by sending xsm a TERM signal (pkill -u $(id -u) xsm).

4
  • I updated the question, check it please. – Mikhail Morfikov Feb 28 '14 at 11:42
  • @MikhailMorfikov You're right, my answer wasn't too helpful if you didn't already use GDM. Is the updated answer any more useful? – aecolley Mar 2 '14 at 3:27
  • That doesn't work either. Besides it saves/restores sessions, and the window that shows after login drives me crazy, as well as the window in the graphical environment -- I can't even close it. Moreover, it has some issues with certain windows like amarok -- it just kills it. And it crashes when I wanted to see the log. – Mikhail Morfikov Mar 2 '14 at 13:14
  • If you don't like xsm (and who does?), you can use another; how about rox.sourceforge.net/desktop/ROX-Session ? And there's always Approach #1. – aecolley Mar 5 '14 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.