This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KF5 startup error: "No DBUS session-bus found"

Tags: None
(comma "," separated)
stavallo
Registered Member
Posts
10
Karma
0
OS
Hello,

with the help of Arch Linux KDE maintainer, Andrea Scarpino, I am packaging and building KDE Frameworks 5 from git repositories. To start a new KF5 session I use lightdm and the provided startkde script modified as follows (I added the environment variables mentioned in the "Building frameworks" community page to take into account that KF5 is installed in /opt/kf5):

Code: Select all
#!/bin/sh
#
#  DEFAULT KDE STARTUP SCRIPT (  )
#

export KF5=/opt/kf5
export QTDIR=/usr
export XDG_CONFIG_DIRS=$KF5/etc/xdg:$XDG_CONFIG_DIRS:/etc/xdg
export PATH=$KF5/bin:$QTDIR/bin:$PATH
export QML2_IMPORT_PATH=$KF5/lib/qml:$KF5/lib64/qml:$KF5/lib/x86_64-linux-gnu/qml:$QTDIR/qml
export XDG_DATA_HOME=$HOME/.local5
export XDG_CONFIG_HOME=$HOME/.config5
export XDG_CACHE_HOME=$HOME/.cache5


if test "x$1" = x--failsafe; then
    KDE_FAILSAFE=1 # General failsafe flag
    KWIN_COMPOSE=N # Disable KWin's compositing
    export KWIN_COMPOSE KDE_FAILSAFE
fi

# When the X server dies we get a HUP signal from xinit. We must ignore it
# because we still need to do some cleanup.
trap 'echo GOT SIGHUP' HUP

# we have to unset this for Darwin since it will screw up KDE's dynamic-loading
unset DYLD_FORCE_FLAT_NAMESPACE

# in case we have been started with full pathname spec without being in PATH
bindir=`echo "$0" | sed -n 's,^\(/.*\)/[^/][^/]*$,\1,p'`
if [ -n "$bindir" ]; then
#  qbindir=`qtpaths --binaries-dir`
  qbindir=`qtpaths-qt5 --binaries-dir`
  qdbus=$qbindir/qdbus
  case $PATH in
    $bindir|$bindir:*|*:$bindir|*:$bindir:*) ;;
    *) PATH=$bindir:$PATH; export PATH;;
  esac
else
#  qdbus=qdbus
  qdbus=qdbus-qt5
fi

if test -z "$XDG_DATA_DIRS"; then
    XDG_DATA_DIRS="/opt/kf5/share:/usr/share:/usr/local/share"
else
    XDG_DATA_DIRS="/opt/kf5/share:$XDG_DATA_DIRS"
fi
export XDG_DATA_DIRS

# Check if a KDE session already is running and whether it's possible to connect to X
kcheckrunning
kcheckrunning_result=$?
if test $kcheckrunning_result -eq 0 ; then
   echo "KDE seems to be already running on this display."
   xmessage -geometry 500x100 "KDE seems to be already running on this display." > /dev/null 2>/dev/null
   exit 1
elif test $kcheckrunning_result -eq 2 ; then
   echo "\$DISPLAY is not set or cannot connect to the X server."
        exit 1
fi

# Boot sequence:
#
# kdeinit is used to fork off processes which improves memory usage
# and startup time.
#
# * kdeinit starts klauncher first.
# * Then kded is started. kded is responsible for keeping the sycoca
#   database up to date. When an up to date database is present it goes
#   into the background and the startup continues.
# * Then kdeinit starts kcminit. kcminit performs initialisation of
#   certain devices according to the user's settings
#
# * Then ksmserver is started which takes control of the rest of the startup sequence

# We need to create config folder so we can write startupconfigkeys
if [  ${XDG_CONFIG_HOME} ]; then
  configDir=$XDG_CONFIG_HOME;
else
  configDir=`readlink -e ~/.config`; #this is the default, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
fi

mkdir -p $configDir

#This is basically setting defaults so we can use them with kstartupconfig4
cat >$configDir/startupconfigkeys <<EOF
kcminputrc Mouse cursorTheme 'Oxygen_White'
kcminputrc Mouse cursorSize ''
ksplashrc KSplash Theme Classic
ksplashrc KSplash Engine KSplashQML
kcmfonts General forceFontDPI 0
kdeglobals Locale Language '' # trigger requesting languages from KLocale
EOF
kstartupconfig5
returncode=$?
if test $returncode -ne 0; then
    xmessage -geometry 500x100 "kstartupconfig5 does not exist or fails. The error code is $returncode. Check your installation."
    exit 1
fi
[ -r $configDir/startupconfig ] && . $configDir/startupconfig

# XCursor mouse theme needs to be applied here to work even for kded or ksmserver
if test -n "$kcminputrc_mouse_cursortheme" -o -n "$kcminputrc_mouse_cursorsize" ; then
    XCURSOR_PATH=/opt/kf5/share/icons:$XCURSOR_PATH":~/.icons:/usr/share/icons:/usr/share/pixmaps:/usr/X11R6/lib/X11/icons"; export XCURSOR_PATH

    kapplymousetheme "$kcminputrc_mouse_cursortheme" "$kcminputrc_mouse_cursorsize"
    if test $? -eq 10; then
        XCURSOR_THEME=default
        export XCURSOR_THEME
    elif test -n "$kcminputrc_mouse_cursortheme"; then
        XCURSOR_THEME="$kcminputrc_mouse_cursortheme"
        export XCURSOR_THEME
    fi
    if test -n "$kcminputrc_mouse_cursorsize"; then
        XCURSOR_SIZE="$kcminputrc_mouse_cursorsize"
        export XCURSOR_SIZE
    fi
fi

if test "$kcmfonts_general_forcefontdpi" -ne 0; then
    xrdb -quiet -merge -nocpp <<EOF
Xft.dpi: $kcmfonts_general_forcefontdpi
EOF
fi

dl=$DESKTOP_LOCKED
unset DESKTOP_LOCKED # Don't want it in the environment

ksplash_pid=
if test -z "$dl"; then
  # languages as resolved by KLocale, for the splash screens use
  # klocale_languages is assembled by kdostartupconfig4 calling KLocale
  KLOCALE_LANGUAGES="$klocale_languages"
  export KLOCALE_LANGUAGES
  # the splashscreen and progress indicator
  case "$ksplashrc_ksplash_engine" in
    KSplashQML)
      ksplash_pid=`ksplashqml "${ksplashrc_ksplash_theme}" --pid`
      ;;
    None)
      ;;
    *)
      ;;
  esac
  # no longer needed in the environment
  unset KLOCALE_LANGUAGES
fi

# Source scripts found in <localprefix>/env/*.sh and <prefixes>/env/*.sh
# (where <localprefix> is $KDEHOME or ~/.kde, and <prefixes> is where KDE is installed)
#
# This is where you can define environment variables that will be available to
# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
# or eval `gpg-agent --daemon`.
# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
#
# (see end of this file).
# For anything else (that doesn't set env vars, or that needs a window manager),
# better use the Autostart folder.

libpath=`kde4-config --path lib | tr : '\n'`

for prefix in `echo "$libpath" | sed -n -e 's,/lib[^/]*/,/env/,p'`; do
  for file in "$prefix"*.sh; do
    test -r "$file" && . "$file"
  done
done

# Set the path for Qt plugins provided by KDE
# QT_PLUGIN_PATH=${QT_PLUGIN_PATH+$QT_PLUGIN_PATH:}`qtpaths --plugin-dir`
QT_PLUGIN_PATH=${QT_PLUGIN_PATH+$QT_PLUGIN_PATH:}`qtpaths-qt5 --plugin-dir`
# TODO: Do we really need this?
# QT_PLUGIN_PATH=$QT_PLUGIN_PATH:$kdehome/lib/kde5/plugins/
# export QT_PLUGIN_PATH
export QT_PLUGIN_PATH=$KF5/lib/plugins:$KF5/lib64/plugins:$KF5/lib/x86_64-linux-gnu/plugins:$QTDIR/plugins:$QT_PLUGIN_PATH


# Activate the kde font directories.
#
# There are 4 directories that may be used for supplying fonts for KDE.
#
# There are two system directories. These belong to the administrator.
# There are two user directories, where the user may add her own fonts.
#
# The 'override' versions are for fonts that should come first in the list,
# i.e. if you have a font in your 'override' directory, it will be used in
# preference to any other.
#
# The preference order looks like this:
# user override, system override, X, user, system
#
# Where X is the original font database that was set up before this script
# runs.

usr_odir=$HOME/.fonts/kde-override
usr_fdir=$HOME/.fonts

if test -n "$KDEDIRS"; then
  kdedirs_first=`echo "$KDEDIRS"|sed -e 's/:.*//'`
  sys_odir=$kdedirs_first/share/fonts/override
  sys_fdir=$kdedirs_first/share/fonts
else
  sys_odir=$KDEDIR/share/fonts/override
  sys_fdir=$KDEDIR/share/fonts
fi

# We run mkfontdir on the user's font dirs (if we have permission) to pick
# up any new fonts they may have installed. If mkfontdir fails, we still
# add the user's dirs to the font path, as they might simply have been made
# read-only by the administrator, for whatever reason.

test -d "$sys_odir" && xset +fp "$sys_odir"
test -d "$usr_odir" && (mkfontdir "$usr_odir" ; xset +fp "$usr_odir")
test -d "$usr_fdir" && (mkfontdir "$usr_fdir" ; xset fp+ "$usr_fdir")
test -d "$sys_fdir" && xset fp+ "$sys_fdir"

# Ask X11 to rebuild its font list.
xset fp rehash

# Set a left cursor instead of the standard X11 "X" cursor, since I've heard
# from some users that they're confused and don't know what to do. This is
# especially necessary on slow machines, where starting KDE takes one or two
# minutes until anything appears on the screen.
#
# If the user has overwritten fonts, the cursor font may be different now
# so don't move this up.
#
xsetroot -cursor_name left_ptr

# Get Ghostscript to look into user's KDE fonts dir for additional Fontmap
if test -n "$GS_LIB" ; then
    GS_LIB=$usr_fdir:$GS_LIB
    export GS_LIB
else
    GS_LIB=$usr_fdir
    export GS_LIB
fi

echo 'startkde: Starting up...'  1>&2

# Make sure that the KDE prefix is first in XDG_DATA_DIRS and that it's set at all.
# The spec allows XDG_DATA_DIRS to be not set, but X session startup scripts tend
# to set it to a list of paths *not* including the KDE prefix if it's not /usr or
# /usr/local.
# if test -z "$XDG_DATA_DIRS"; then
#     XDG_DATA_DIRS="/opt/kf5/share:/usr/share:/usr/local/share"
# else
#     XDG_DATA_DIRS="/opt/kf5/share:$XDG_DATA_DIRS"
# fi
# export XDG_DATA_DIRS

# Make sure that D-Bus is running
# D-Bus autolaunch is broken
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
    eval `dbus-launch --sh-syntax --exit-with-session`
fi
if $qdbus >/dev/null 2>/dev/null; then
    : # ok
else
    echo 'startkde: Could not start D-Bus. Can you call qdbus?'  1>&2
    test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
    xmessage -geometry 500x100 "Could not start D-Bus. Can you call qdbus?"
    exit 1
fi


# Mark that full KDE session is running (e.g. Konqueror preloading works only
# with full KDE running). The KDE_FULL_SESSION property can be detected by
# any X client connected to the same X session, even if not launched
# directly from the KDE session but e.g. using "ssh -X", kdesu. $KDE_FULL_SESSION
# however guarantees that the application is launched in the same environment
# like the KDE session and that e.g. KDE utilities/libraries are available.
# KDE_FULL_SESSION property is also only available since KDE 3.5.5.
# The matching tests are:
#   For $KDE_FULL_SESSION:
#     if test -n "$KDE_FULL_SESSION"; then ... whatever
#   For KDE_FULL_SESSION property:
#     xprop -root | grep "^KDE_FULL_SESSION" >/dev/null 2>/dev/null
#     if test $? -eq 0; then ... whatever
#
# Additionally there is (since KDE 3.5.7) $KDE_SESSION_UID with the uid
# of the user running the KDE session. It should be rarely needed (e.g.
# after sudo to prevent desktop-wide functionality in the new user's kded).
#
# Since KDE4 there is also KDE_SESSION_VERSION, containing the major version number.
# Note that this didn't exist in KDE3, which can be detected by its absense and
# the presence of KDE_FULL_SESSION.
#
KDE_FULL_SESSION=true
export KDE_FULL_SESSION
xprop -root -f KDE_FULL_SESSION 8t -set KDE_FULL_SESSION true

KDE_SESSION_VERSION=5
export KDE_SESSION_VERSION
xprop -root -f KDE_SESSION_VERSION 32c -set KDE_SESSION_VERSION 5

KDE_SESSION_UID=`id -ru`
export KDE_SESSION_UID

XDG_CURRENT_DESKTOP=KDE
export XDG_CURRENT_DESKTOP

# We set LD_BIND_NOW to increase the efficiency of kdeinit.
# kdeinit unsets this variable before loading applications.
LD_BIND_NOW=true /opt/kf5/lib/kde5/libexec/start_kdeinit_wrapper +kcminit_startup
if test $? -ne 0; then
  # Startup error
  echo 'startkde: Could not start kdeinit5. Check your installation.'  1>&2
  test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
  xmessage -geometry 500x100 "Could not start kdeinit5. Check your installation."
  exit 1
fi

# finally, give the session control to the session manager
# see kdebase/ksmserver for the description of the rest of the startup sequence
# if the KDEWM environment variable has been set, then it will be used as KDE's
# window manager instead of kwin.
# if KDEWM is not set, ksmserver will ensure kwin is started.
# kwrapper5 is used to reduce startup time and memory usage
# kwrapper5 does not return useful error codes such as the exit code of ksmserver.
# We only check for 255 which means that the ksmserver process could not be
# started, any problems thereafter, e.g. ksmserver failing to initialize,
# will remain undetected.
test -n "$KDEWM" && KDEWM="--windowmanager $KDEWM"
# If the session should be locked from the start (locked autologin),
# lock now and do the rest of the KDE startup underneath the locker.
KSMSERVEROPTIONS=""
test -n "$dl" && KSMSERVEROPTIONS=" --lockscreen"
kwrapper5 ksmserver $KDEWM $KSMSERVEROPTIONS
if test $? -eq 255; then
  # Startup error
  echo 'startkde: Could not start ksmserver. Check your installation.'  1>&2
  test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
  xmessage -geometry 500x100 "Could not start ksmserver. Check your installation."
fi

wait_drkonqi=`kreadconfig --file startkderc --group WaitForDrKonqi --key Enabled --default true`

if test x"$wait_drkonqi"x = x"true"x ; then
    # wait for remaining drkonqi instances with timeout (in seconds)
    wait_drkonqi_timeout=`kreadconfig --file startkderc --group WaitForDrKonqi --key Timeout --default 900`
    wait_drkonqi_counter=0
    while $qdbus | grep "^[^w]*org.kde.drkonqi" > /dev/null ; do
        sleep 5
        wait_drkonqi_counter=$((wait_drkonqi_counter+5))
        if test "$wait_drkonqi_counter" -ge "$wait_drkonqi_timeout" ; then
            # ask remaining drkonqis to die in a graceful way
            $qdbus | grep 'org.kde.drkonqi-' | while read address ; do
                $qdbus "$address" "/MainApplication" "quit"
            done
            break
        fi
    done
fi

echo 'startkde: Shutting down...'  1>&2
# just in case
test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null

# Clean up
kdeinit5_shutdown

echo 'startkde: Running shutdown scripts...'  1>&2

# Run scripts found in $KDEDIRS/shutdown
for prefix in `echo "$libpath" | sed -n -e 's,/lib[^/]*/,/shutdown/,p'`; do
  for file in `ls "$prefix" 2> /dev/null | egrep -v '(~|\.bak)$'`; do
    test -x "$prefix$file" && "$prefix$file"
  done
done

unset KDE_FULL_SESSION
xprop -root -remove KDE_FULL_SESSION
unset KDE_SESSION_VERSION
xprop -root -remove KDE_SESSION_VERSION
unset KDE_SESSION_UID

echo 'startkde: Done.'  1>&2


However, this results in running the X server, setting the oxygen mouse cursor and blocking in a black screen. This is with fresh user account. .xsession-errors contains:

Code: Select all
QCoreApplication::arguments: Please instantiate the QApplication object first
QCoreApplication::arguments: Please instantiate the QApplication object first
QCoreApplication::arguments: Please instantiate the QApplication object first
QCoreApplication::arguments: Please instantiate the QApplication object first
startkde: Starting up...
QStandardPaths: wrong ownership on runtime directory /run/user/1001, 1001 instead of 0
QStandardPaths: wrong ownership on runtime directory /run/user/1001, 1001 instead of 0
No DBUS session-bus found. Check if you have started the DBUS server.
kdeinit5: Communication error with launcher. Exiting!
kdeinit5_wrapper: Warning: connect(/run/user/1001/kdeinit5__1) failed: : No such file or directory
"Qt Warning - invalid keysym: dead_actute"
Qt: Session management error: networkIdsList argument is NULL
Your code needs to be ported in KF5.  See the Ki18n programmers guide.
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kglobalaccel was not provided by any .service files")
Failed to connect to the kglobalaccel daemon QDBusError("org.freedesktop.DBus.Error.NameHasNoOwner", "Could not get owner of name 'org.kde.kglobalaccel': no such name")
XSync seems available and ready
XSync Inited
Supported, init completed
"/run/user/1001/KSMserver"
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
"Qt Warning - invalid keysym: dead_actute"
Extensions: shape: 0x "11"  composite: 0x "4"  render: 0x "b"  fixes: 0x "50"  randr: 0x "14"  sync: 0x "31"  damage: 0x  "11"

kwin : path  "/opt/kf5/lib/plugins/kf5/kwin3_oxygen.so"  for  "kwin3_oxygen"
Couldn't start kglobalaccel from org.kde.kglobalaccel.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kglobalaccel was not provided by any .service files")
Failed to connect to the kglobalaccel daemon QDBusError("org.freedesktop.DBus.Error.NameHasNoOwner", "Could not get owner of name 'org.kde.kglobalaccel': no such name")
Failed to connect to the kglobalaccel daemon QDBusError("org.freedesktop.DBus.Error.NameHasNoOwner", "Could not get owner of name 'org.kde.kglobalaccel': no such name")


Any idea about how to better investigate and solve this issue?

Many thanks
stavallo
Registered Member
Posts
10
Karma
0
OS
By playing with /etc/dbus-1/{session,system}-local.conf (as described in a tutorial on techbase.kde.org), I managed to remove a lot of errors from .xsession-errors, which now looks like:

Code: Select all
QCoreApplication::arguments: Please instantiate the QApplication object first
QCoreApplication::arguments: Please instantiate the QApplication object first
QCoreApplication::arguments: Please instantiate the QApplication object first
QCoreApplication::arguments: Please instantiate the QApplication object first
startkde: Starting up...
QStandardPaths: wrong ownership on runtime directory /run/user/1001, 1001 instead of 0
QStandardPaths: wrong ownership on runtime directory /run/user/1001, 1001 instead of 0
No DBUS session-bus found. Check if you have started the DBUS server.
kdeinit5: Communication error with launcher. Exiting!
kdeinit5_wrapper: Warning: connect(/run/user/1001/kdeinit5__0) failed: : No such file or directory
"Qt Warning - invalid keysym: dead_actute"
Qt: Session management error: networkIdsList argument is NULL
Your code needs to be ported in KF5.  See the Ki18n programmers guide.
XSync seems available and ready
XSync Inited
Supported, init completed
"/run/user/1001/KSMserver"
QDBusConnection: name 'org.kde.kglobalaccel' had owner '' but we thought it was ':1.3'
detected kglobalaccel restarting, re-registering all shortcut keys                                                                                               
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.                                                             
"Qt Warning - invalid keysym: dead_actute"                                                                                                                       
Extensions: shape: 0x "11"  composite: 0x "4"  render: 0x "b"  fixes: 0x "50"  randr: 0x "14"  sync: 0x "31"  damage: 0x  "11"                                   
                                                                                                                                                                 
kwin : path  "/opt/kf5/lib/plugins/kf5/kwin3_oxygen.so"  for  "kwin3_oxygen"                                                                                     
screens:  1 desktops:  1                                                                                                                                         
Done.                                                                                                                                                             
screens:  1 desktops:  1                                                                                                                                         
Done.
QXcbConnection: XCB error: 3 (BadWindow), sequence: 471, resource id: 0, major code: 15 (QueryTree), minor code: 0
Initializing OpenGL compositing
Drawable visual (depth  24 ): 0x "8c"
Drawable visual (depth  32 ): 0x "5e"
Buffer visual (depth  24 ): 0x "8b"
Direct rendering: true

Color correction: false
OpenGL 2 compositing successfully initialized
Vertical Refresh rate  60 Hz
Trying to open ksycoca from "/home/prova/.cache5/ksycoca5"
Trying to open global ksycoca from  "/home/prova/.local5/kde5/services/ksycoca5"
Trying to open ksycoca from "/home/prova/.cache5/ksycoca5"
Trying to open global ksycoca from  "/home/prova/.local5/kde5/services/ksycoca5"
Still no database...
No ksycoca database available! Tried running kbuildsycoca5 ?
KServiceTypeTrader: serviceType "KWin/Effect" not found
Trying to open ksycoca from "/home/prova/.cache5/ksycoca5"
Trying to open global ksycoca from  "/home/prova/.local5/kde5/services/ksycoca5"
Trying to open ksycoca from "/home/prova/.cache5/ksycoca5"
Trying to open global ksycoca from  "/home/prova/.local5/kde5/services/ksycoca5"
Still no database...
No ksycoca database available! Tried running kbuildsycoca5 ?
KServiceTypeTrader: serviceType "KWin/Script" not found


However, logging into a KDE Frameworks 5 session still leads to a black screen with the oxygen mouse cursor.

I think the most worrisome message is "kdeinit5: Communication error with launcher. Exiting!"

Any idea? Thanks.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Based on what I can see there:
1) kbuildsycoca5 --noincremental has not been run for this session.
2) The dbus-daemon for the session has not been started - which is why kdeinit5 fails to start.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
stavallo
Registered Member
Posts
10
Karma
0
OS
Thanks for your reply. However, it seems that the dbus daemon for the session has been started:

output of 'ps aux | grep dbus' before log in:
Code: Select all
dbus       355  0.0  0.0  17800  1952 ?        Ss   15:15   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
lightdm   1055  0.0  0.0  18004   552 ?        S    15:22   0:00 dbus-launch --autolaunch 9333fda2f66d415a871399665d593e34 --binary-syntax --close-stderr
lightdm   1056  0.0  0.0  17312   840 ?        Ss   15:22   0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session


output of 'ps aux | grep dbus' after log in: (kde is the user logged in)
Code: Select all
dbus       355  0.0  0.0  17800  1952 ?        Ss   15:15   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
lightdm   1055  0.0  0.0  18004   552 ?        S    15:22   0:00 dbus-launch --autolaunch 9333fda2f66d415a871399665d593e34 --binary-syntax --close-stderr
lightdm   1056  0.0  0.0  17312   840 ?        Ss   15:22   0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
kde       1205  0.0  0.0  15904   632 ?        S    15:25   0:00 dbus-launch --sh-syntax --exit-with-session
kde       1206  0.0  0.0  17312   824 ?        Ss   15:25   0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session


Looks like a session bus has been created, isn't it? Is it possible that kdeinit5 does not "find" the session bus?

Thanks again.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Could you please check that the command "qdbus" works from a terminal in this KF5 environment?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
stavallo
Registered Member
Posts
10
Karma
0
OS
In the startkde script I replaced the line:

if $qdbus >/dev/null 2>/dev/null; then

with

if $qdbus > qdbus.out 2>qdbus.err; then

qdbus.err is empty, while qdbus.out only contains:

Code: Select all
:1.0
org.freedesktop.DBus


Unfortunately I cannot open a terminal in the KF5 session because what I get is a black screen with the oxygen mouse cursor and I cannot launch anything. I tried to add the line:

exec xterm -geometry 80x66+0+0 -name login

in the startkde script just before the drkonqi section, but I didn't get anything as well.

Any other suggestion?

Thanks a lot for your help.
stavallo
Registered Member
Posts
10
Karma
0
OS
A few more bits of information.

Within the startkde script, I moved the line "exec xterm -geometry 80x66+0+0 -name login" *before* the block that launches ksmserver. That allowed me to get the terminal emulator. I checked the existence of a session bus (the env variable DBUS_SESSION_BUS_ADDRESS is set). From within the terminal emulator I can launch konsole and kate (KF5 version). I can also run "kwin --replace" and "plasma-shell" and I get a (sort of) working environment.

After launching some applications, the qdbus output grows:

Code: Select all
:1.10                                                                                                                                                             
 org.kde.DeviceNotifications                                                                                                                                     
 org.kde.StatusNotifierHost-19490                                                                                                                                 
 org.kde.plasma_shell                                                                                                                                             
:1.11                                                                                                                                                             
 org.kde.ActivityManager                                                                                                                                         
:1.12                                                                                                                                                             
 org.kde.JobViewServer                                                                                                                                           
 org.kde.kuiserver                                                                                                                                               
:1.18                                                                                                                                                             
:1.5                                                                                                                                                             
 org.kde.kglobalaccel                                                                                                                                             
:1.7                                                                                                                                                             
 org.kde.kded5
:1.8
 org.kde.KWin
 org.kde.kwin.Screenshot
org.freedesktop.DBus


Hence, I suspect that my problems are caused by ksmserver not properly starting, which prevents kdeinit5 from running. If I run "kdeinit5" from the terminal emulator I get:

Code: Select all
Qt: Session management error: networkIdsList argument is NULL


Any suggestion how to investigate further?

Many thanks in advance.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
I've just reviewed the logs again. Can you check that all processes are running under the correct user?
Code: Select all
QStandardPaths: wrong ownership on runtime directory /run/user/1001, 1001 instead of 0
QStandardPaths: wrong ownership on runtime directory /run/user/1001, 1001 instead of 0

This seems to imply that Qt 5 code is running as root, instead of the user it is supposed to be running as - which would explain why it is unable to access the D-Bus session, among other things.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
stavallo
Registered Member
Posts
10
Karma
0
OS
This is the output of 'ps auxf' from the terminal:

Code: Select all
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         2  0.0  0.0      0     0 ?        S    19:02   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/0:0]
root         5  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/0:0H]
root         6  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/u16:0]
root         7  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [migration/0]
root         8  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [rcu_preempt]
root         9  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [rcu_bh]
root        10  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [rcu_sched]
root        11  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [watchdog/0]
root        12  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [watchdog/1]
root        13  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [migration/1]
root        14  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [ksoftirqd/1]
root        15  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/1:0]
root        16  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/1:0H]
root        17  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [watchdog/2]
root        18  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [migration/2]
root        19  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [ksoftirqd/2]
root        20  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/2:0]
root        21  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/2:0H]
root        22  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [watchdog/3]
root        23  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [migration/3]
root        24  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [ksoftirqd/3]
root        25  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/3:0]
root        26  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/3:0H]
root        27  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [watchdog/4]
root        28  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [migration/4]
root        29  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [ksoftirqd/4]
root        30  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/4:0]
root        31  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/4:0H]
root        32  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [watchdog/5]
root        33  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [migration/5]
root        34  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [ksoftirqd/5]
root        35  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/5:0]
root        36  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/5:0H]
root        37  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [watchdog/6]
root        38  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [migration/6]
root        39  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [ksoftirqd/6]
root        40  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/6:0]
root        41  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/6:0H]
root        42  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [watchdog/7]
root        43  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [migration/7]
root        44  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [ksoftirqd/7]
root        45  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/7:0]
root        46  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/7:0H]
root        47  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [khelper]
root        48  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kdevtmpfs]
root        49  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [netns]
root        50  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [writeback]
root        51  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [bioset]
root        52  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kblockd]
root        53  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/2:1]
root        54  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [khungtaskd]
root        55  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kswapd0]
root        56  0.0  0.0      0     0 ?        SN   19:02   0:00  \_ [ksmd]
root        57  0.0  0.0      0     0 ?        SN   19:02   0:00  \_ [khugepaged]
root        58  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [fsnotify_mark]
root        59  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [crypto]
root        64  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kthrotld]
root        65  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/2:2]
root        66  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [deferwq]
root        67  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/u16:1]
root        71  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/4:1]
root       101  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [khubd]
root       102  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [ata_sff]
root       103  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/u16:2]
root       104  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [scsi_eh_0]
root       105  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [scsi_eh_1]
root       106  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [scsi_eh_2]
root       107  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [scsi_eh_3]
root       108  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [scsi_eh_4]
root       109  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/u16:3]
root       110  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/u16:4]
root       111  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/u16:5]
root       112  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/u16:6]
root       113  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/3:1]
root       114  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/1:1]
root       115  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/0:1]
root       116  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/5:1]
root       120  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/0:1H]
root       121  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/4:1H]
root       122  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/5:1H]
root       123  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/3:1H]
root       124  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/7:1H]
root       125  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/2:1H]
root       126  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/6:1H]
root       127  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/6:1]
root       133  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/7:1]
root       138  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [jbd2/sda4-8]
root       139  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [ext4-rsv-conver]
root       165  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/0:2]
root       167  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/1:2]
root       168  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kworker/1:1H]
root       171  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/3:2]
root       175  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/5:2]
root       181  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/4:2]
root       188  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [kworker/7:2]
root       226  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kpsmoused]
root       227  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [irq/48-mei_me]
root       230  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [hd-audio1]
root       240  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kmemstick]
root       322  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [kvm-irqfd-clean]
root       326  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [hd-audio0]
root       330  0.0  0.0      0     0 ?        S    19:02   0:00  \_ [jbd2/sda5-8]
root       331  0.0  0.0      0     0 ?        S<   19:02   0:00  \_ [ext4-rsv-conver]
root         1  0.1  0.0  31608  2976 ?        Ss   19:02   0:00 /sbin/init
root       157  0.0  0.0 156244 12556 ?        Ss   19:02   0:00 /usr/lib/systemd/systemd-journald
root       193  0.1  0.0  32420  2340 ?        Ss   19:02   0:00 /usr/lib/systemd/systemd-udevd
root       350  0.0  0.0  64956  4072 ?        Ss   19:02   0:00 /usr/bin/cupsd -f
root       351  0.0  0.0 323064  7112 ?        Ssl  19:02   0:00 /usr/bin/NetworkManager --no-daemon
root       352  0.0  0.0  25836  1648 ?        Ss   19:02   0:00 /usr/lib/systemd/systemd-logind
dbus       354  0.0  0.0  17800  1860 ?        Ss   19:02   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root       356  0.0  0.0 265424  3324 ?        SLsl 19:02   0:00 /usr/bin/lightdm
root       359  0.1  0.1 195260 32600 tty1     Ssl+ 19:02   0:00  \_ /usr/sbin/X :0 -auth /run/lightdm/root/:0 -nolisten tcp vt1 -novtswitch
root       463  0.0  0.0 164032  3568 ?        Sl   19:02   0:00  \_ lightdm --session-child 12 19
kde        471  0.0  0.0  73676  7152 ?        Ss   19:02   0:00      \_ xterm -geometry 80x66+0+0 -name login
kde        514  0.0  0.0  16376  2608 pts/0    Ss   19:02   0:00          \_ bash
kde        520  0.0  0.0  13252  1444 pts/0    R+   19:04   0:00              \_ ps auxf
polkitd    371  0.0  0.0 506316 13024 ?        Ssl  19:02   0:00 /usr/lib/polkit-1/polkitd --no-debug
root       380  0.0  0.0  39720  2752 ?        Ss   19:02   0:00 /usr/bin/sshd -D
root       385  0.0  0.0  77116  1124 ?        Ss   19:02   0:00 /usr/bin/svnserve --daemon --pid-file=/run/svnserve/svnserve.pid -r /usr/share/subversion
root       387  0.0  0.0 295536 13748 ?        Ssl  19:02   0:00 /usr/lib/colord/colord
lightdm    395  0.0  0.0  28720  1980 ?        Ss   19:02   0:00 /usr/lib/systemd/systemd --user
lightdm    398  0.0  0.0  67228  1208 ?        S    19:02   0:00  \_ (sd-pam) 
lightdm    402  0.0  0.0  18004   556 ?        S    19:02   0:00 dbus-launch --autolaunch 9333fda2f66d415a871399665d593e34 --binary-syntax --close-stderr
lightdm    403  0.0  0.0  17312   820 ?        Ss   19:02   0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
root       440  0.0  0.0 227316  4768 ?        Ssl  19:02   0:00 /usr/lib/upower/upowerd
kde        469  0.0  0.0  28720  1972 ?        Ss   19:02   0:00 /usr/lib/systemd/systemd --user
kde        470  0.0  0.0  67228  1228 ?        S    19:02   0:00  \_ (sd-pam) 
kde        478  0.0  0.0  15904   628 ?        S    19:02   0:00 dbus-launch --sh-syntax --exit-with-session
kde        479  0.0  0.0  17312   896 ?        Ss   19:02   0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session


There is a special file created in the root (/) directory:
Code: Select all
srw------- 1 root kde 0 Jan 20 19:02 /kdeinit5__0


Does this suggest that kdeinit is run as root? Any other suggestion about what to check?

Many thanks in advance.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
I'm afraid I don't have much idea here - that all looks fine, however there is a total lack of any trace indicating that KDE is even running on that system. In terms of the /kdeinit5__0 socket, I would suggest removing it. The permissions on it are very unusual, but are consistent to a certain extent with what would occur if you were to run a key KDE process as root.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
eliasp
Registered Member
Posts
19
Karma
0
OS
bcooksley wrote:I've just reviewed the logs again. Can you check that all processes are running under the correct user?
Code: Select all
QStandardPaths: wrong ownership on runtime directory /run/user/1001, 1001 instead of 0
QStandardPaths: wrong ownership on runtime directory /run/user/1001, 1001 instead of 0

This seems to imply that Qt 5 code is running as root, instead of the user it is supposed to be running as - which would explain why it is unable to access the D-Bus session, among other things.


That's a known pam_systemd bug.
See also:
http://lists.freedesktop.org/archives/s ... 14370.html
https://bugzilla.redhat.com/show_bug.cgi?id=753882#c71
bshah
Registered Member
Posts
77
Karma
0
OS
Hmm any progress on this or workaround?
workoft
Registered Member
Posts
97
Karma
1
I was pointed here from this topic: viewtopic.php?f=287&t=121306
I worked around my problem (to a point where I could run plasma-workspace, not where it worked well, although I don't yet know what my other problems are caused by) by adding export XDG_RUNTIME_DIR=/var/run/$UID to the top of /usr/bin/startkde. The folder /var/run/$UID may have to be created and given the correct permissions.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft