You are not logged in.

#1 2017-02-17 07:29:25

Aaaaaaare
Member
Registered: 2017-02-17
Posts: 6

KDE works on root but not for users

Hi!

Im quite lost with Arch.
I installed the KDE and Xorg for the desktop environment and i launching it with the command startx (I changed the .xinitcr file as https://wiki.archlinux.org/index.php/KDE said).

When i launch it as a root, all fine. But when i launch it logged as a user, with the command "sudo startx", i got an error: Could not sync environment to dbus

I have read some post about this, but all of them are from 2015 and all the issues were fixed with the (by that time) new release of plasma.

I have all up to date, plasma-desktop is v5.9.2-1, qt5-qtbase v5.8.0-5, xorg-server v1.19.1-2 ... (what else is important?)... but the KDE only runs if it is launched by the root, as I said, and gives that "Could not sync environment to dbus" error if launched by a user.

Any idea? I can only fine the 2 years old "update" trick (clearly not the right solution now)

Offline

#2 2017-02-17 07:32:05

Aaaaaaare
Member
Registered: 2017-02-17
Posts: 6

Re: KDE works on root but not for users

sorry, forgot to add: dbus v1.10.14-1

Offline

#3 2017-02-17 07:55:50

seth
Member
Registered: 2012-09-03
Posts: 51,213

Re: KDE works on root but not for users

But when i launch it logged as a user, with the command "sudo startx"

Why do you sudo? This way the effective KDE user will become root (which is not your active login)
Just "startx", if that still fails, please provide your xinitrc and complete error messages, also lookup your journal.

Offline

#4 2017-02-17 12:10:55

Aaaaaaare
Member
Registered: 2017-02-17
Posts: 6

Re: KDE works on root but not for users

If i dont use the sudo, then only the Xorg is launched, without the KDE (only an ugly 3weird-looking windows interface).
However, with the sudo command, the screen goes black with a cursor (that i can control) and with a small window saying "Could not sync environment to dbus". When i close it, i got this output:

[other things shared with the successful launch of xinitcr as a root]
(==) Log file: "/var/log/Xorg.0.log", Time: Fri Feb 17 21:02:54 2017
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
Failed to connect to bus: No such file or directory
dbus-update-activation-environment: error: unable to connect to D-Bus: Using X11 dor dbus-daemon autolaunch was disabled at co*ile time, set your DBUS_SESSION_BUS_ADDRESS instead
Loading stage @initial@ 1436 startkde: starting up...
dbus-update-activation-environment: error: unable to connect to D-Bus: Using X11 dor dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
startkde: Could not sync environment to dbus.
Warning: locale not supported by C library, locale unchanged
xinit: connection to X server lost
waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.

By the way, all the files that it mention *the config directory and the log file), both do exist in those paths (the log file has many things, is very big).

Offline

#5 2017-02-17 12:16:12

sl1pkn07
Member
From: Spanishtán
Registered: 2010-03-30
Posts: 371

Re: KDE works on root but not for users

what is the content of you $HOME/.xinitrc?

└───╼  cat ~/.xinitrc 
exec startkde

Offline

#6 2017-02-17 12:21:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: KDE works on root but not for users

Running X as root is dangerous.  Running any command that doesn't need to be run as root can be dangerous.  Break this habbit.

In fact, running random commands as root is almost certainly the cause of this problem.  If you edited ~/.xinitrc as root, you only edited the root user's xinitrc.  You need to edit the ~/.xinitrc of your user account.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2017-02-17 12:28:21

Aaaaaaare
Member
Registered: 2017-02-17
Posts: 6

Re: KDE works on root but not for users

sl1pkn07 wrote:

what is the content of you $HOME/.xinitrc?

└───╼  cat ~/.xinitrc 
exec startkde

The file has:
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME./Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

if [ -f $sysresources ]; then
  xrbd -merge $sysresources
fi

if [ -f $sysmodemap ]; then
  xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
  xrbd -merge "$userresources"
fi

if [ -f "$usermodemap" ]; then
  xmodmap  "$usermodemap"
fi

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

exec startkde

Offline

#8 2017-02-17 12:32:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: KDE works on root but not for users

I suspect that is the result of running the requested command as root.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2017-02-17 12:34:37

Aaaaaaare
Member
Registered: 2017-02-17
Posts: 6

Re: KDE works on root but not for users

Trilby wrote:

I suspect that is the result of running the requested command as root or with sudo.

Thank you for the advice, i will do as you said for now on.
I just copy the xinitrc file in my user account too (I, indeed, make it as a root only), but is still the same.
If i run the command startx as user, it only runs the Xorg interface, and not the KDE

Offline

#10 2017-02-17 12:38:11

Aaaaaaare
Member
Registered: 2017-02-17
Posts: 6

Re: KDE works on root but not for users

No, Wait!! I had a typo mistake.... You were correct, Trilby, now it seems to be running as a normal user. Thank you so much (to all the ones that replied here). I will make sure to follow the avoid root commands.

Offline

#11 2017-02-17 12:38:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: KDE works on root but not for users

Aaaaaaare wrote:

I just copy the xinitrc file in my user account too

How did you do this?  Please post the output of the following commands run one after the other:

echo $UID
cd ~
stat .xinitrc
cat .xinitrc

Please use [ code ] tags for the output.

EDIT: nevermind - this was cross posted with the correction above.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB