LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Problem with starting OpenBox in Slackware 14.0 (https://www.linuxquestions.org/questions/slackware-14/problem-with-starting-openbox-in-slackware-14-0-a-4175436019/)

alexbrui 11-07-2012 01:43 AM

Problem with starting OpenBox in Slackware 14.0
 
I want to use OpenBox on my Slackware 14.0. So I download SlackBuild and sources from SBo, compile and install package. Then I run xwmconfig as root and select openbox-session as default WM. But... When OpenBox started from XDM it fails and in ~/.xsession-errors I get
Quote:

XDM authorization key matches an existing client!Openbox-Message: Cannot open display from DISPLAY variable
If I boot with run-level 3 and login I get message
Quote:

cannot open display "default display"
In same time I can start FluxBox both from console and XDM without any errors. Any ideas what is wrong and how to fix this?

P.S. I found thread with similar problem, but it didn't helps.

GazL 11-07-2012 07:05 AM

Yes, this issue caused a lot of problems with the included window-managers when 14.0 was being finalised.
Here's part of a mail I sent to Pat where I describe what I think is going on:
Quote:

The recent dbus-launch change to xinitrc.blackbox appears to break under XDM with the following error:
XDM authorization key matches an existing client!bt::Display: failed to open display ''


My best guess at what is going on is that dbus-launch connects to the Xserver for whatever nefarious reasons it has but doesn't disconnect before calling exec() on the command specified in it's arguments. When the exec'd window manager later tries to connect to the Xserver it goes "Hang On! I've already got a connection from that process!" and throws a hissy-fit.

The result appears to be that any window manager that is started by a script appears to work when passed as an argument to dbus-launch, but those that are simple executables, such as blackbox and dwm cause the above error and the session terminates. (interestingly, fvwm doesn't appear to suffer this despite being a direct executable - I have no idea why)
That other thread you link to was some of my early attempts at working around the issue, but we quickly found that it worked for some window-managers, but not all.
The following is the approach I use now, which has proven reliable (here at any rate). I don't have openbox installed, but dwm suffered the same issue, and this is how I now resolve it.

xinitrc.dwm:
Code:

#!/bin/sh
#  xinitrc.dwm v1.4

startwm='/usr/bin/startdwm --with-dbus'

########################################################################
##  Merge in defaults and keymaps                                    ##
########################################################################

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

[ -f $sysresources ] && /usr/bin/xrdb -merge $sysresources
[ -f $sysmodmap ] && /usr/bin/xmodmap $sysmodmap
[ -f $userresources ] && /usr/bin/xrdb -merge $userresources
[ -f $usermodmap ] && /usr/bin/xmodmap $usermodmap


########################################################################
##  Set background / wallpaper                                        ##
########################################################################

xsetroot -solid grey12


########################################################################
##  Start Window Manager                                              ##
########################################################################

if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
    exec ck-launch-session $startwm
else
    exec $startwm
fi


########################################################################

And then the window manager startup script looks something like this and starts dbus (if requested)
Code:

#!/bin/sh
#  startdwm v1.1

########################################################################
##  Start DBUS session bus                                            ##
########################################################################

if [ "$1" = '--with-dbus' ]; then
  if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
      eval `dbus-launch --sh-syntax --exit-with-session`
  fi
fi


########################################################################
##  Start dwm Window Manager                                          ##
########################################################################

xsetroot -name "$USER ($DISPLAY)"

exec /usr/bin/dwm


########################################################################

Perhaps you can try the same approach with Openbox.

ml4711 11-07-2012 08:23 AM

I had this error with xmonad:

XDM authorization key matches an existing client!xmonad-x86_64-linux: user error (openDisplay)

An easy solution is to add one line to /etc/X11/xdm/xdm-config

Code:

DisplayManager*authorize: true
DisplayManager*authName: MIT-MAGIC-COOKIE-1  <-- add this line


D1ver 11-07-2012 03:56 PM

Interesting.. I installed Openbox using the 14.0 Slackbuilds on a fresh install of 14.0 and have had no issues..

alexbrui 11-08-2012 01:26 AM

Just tried to add
Code:

DisplayManager*authName: MIT-MAGIC-COOKIE-1
to my xdm-config and this solves issue with starting OpenBox from XDM. But message
Quote:

cannot open display "default display"
on run-level 3 still here.

D1ver, maybe different package sets? I didn't install all, e.g. skipped KDE, KDEI, XFCE and Y series. Also skipped some packeges from all other series.

alexbrui 11-09-2012 09:44 AM

Also tried with full Slackware install and issue persist.

Finally I solve it as GazL suggested, but instead creating separate script I add dbus-launch to Openbox startup script.


All times are GMT -5. The time now is 09:42 PM.