LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 06-14-2019, 09:50 AM   #1
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
kill dbus session on logout : how to?


I got this distro called ArcoLinux, it is okay. I added e16 to it, Now I get this random dbus issue, when I logout then in again. I am seeing it when I logout then back in a few times that sometimes needs to be done. then on a second or third attempt it hangs.

using the ctrl+alt+backspace logs out the session as well, hitting this repeatedly to try and get it to reset, because I do (sometimes), I also found out when it logs in and just sits there not completing the login starting of the e16 or session of another desktop, eventually if left alone it will go completely into the session.

It was giving me a message a while ago which I posted on their forum that they gave me no solution. Which lead me to thinking can the session bus address to the user be killed and reestablished upon another login?

IN googling on this finding out i am not the only other one with what thought. Still I have not found a how to on it.

http://manpages.ubuntu.com/manpages/...-launch.1.html

in that page shows a method of how to setup a dbus address, mine is like this.
Code:
#!/bin/sh
 
        # Start DBUS session bus:
        if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
        {
        eval `dbus-launch --sh-syntax --exit-with-session`
                echo "setting: $DBUS_SESSION_BUS_ADDRESS"
        export DBUS_SESSION_BUS_ADDRESS
        }
        else
                echo "alldone $DBUS_SESSION_BUS_ADDRESS"
        fi

        /usr/bin/starte16
which gives me this
Code:
[userx@arcomeo ~]$ echo $DBUS_SESSION_BUS_ADDRESS
unix:path=/run/user/1000/bus
but after having to logout and in again a few times without waiting like for over 5 minutes it stuck again and when I let it sit until it completed its logging into the session completely. (e16) then everything did not start, so when I tried starting on the command line to see what I'd see I got this as I do believe as direct result of this dbus issue. If you look at the very bottom you'll see this dbus connection refused message.


Code:
[userx@arcomeo ~]$ wmix
wmix: mixer-alsa.c:301: mixer_alsa_set_channel: Assertion `(element >= 0) && (element < n_elements)' failed.
Aborted (core dumped)


[userx@arcomeo ~]$ variety
Traceback (most recent call last):
  File "/usr/bin/variety", line 39, in <module>
    variety.main()
  File "/usr/lib/python3.7/site-packages/variety/__init__.py", line 154, in main
    bus = dbus.SessionBus()
  File "/usr/lib/python3.7/site-packages/dbus/_dbus.py", line 211, in __new__
    mainloop=mainloop)
  File "/usr/lib/python3.7/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib/python3.7/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /run/user/1000/bus: Connection refused

Last edited by BW-userx; 06-14-2019 at 09:51 AM.
 
Old 06-15-2019, 11:34 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
yes, I'd say you need to start a new session (and kill the old one).

what's being eval'd in your script?
"--exit-with-session" sounds like the correct switch. man page says what about it and possible other switches?
maybe you need to explicitly "dbus-launch --kill" or some such, on logout?

Is Arcolinux a systemd distro?
 
Old 06-16-2019, 03:20 PM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by ondoho View Post
yes, I'd say you need to start a new session (and kill the old one).

what's being eval'd in your script?
"--exit-with-session" sounds like the correct switch. man page says what about it and possible other switches?
maybe you need to explicitly "dbus-launch --kill" or some such, on logout?

Is Arcolinux a systemd distro?
e16 uses a session.sh script
Code:
# - "stop"  when e16 exits without restarting
#in a case statement it uses I have this


	stop)
	RunApps Stop
	pkill -u $USER
	;;
that I do suppose is suppose to kill everything the logged in user is running. because if I ran that in a terminal it logs me out. but dbus is still active. I do not know if maybe , now that I think about it, the login manager may have something to do with this process as well.

and yes it is a systemD ( blah ) system...
 
Old 06-17-2019, 12:08 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by BW-userx View Post
e16 uses a session.sh script
Code:
# - "stop"  when e16 exits without restarting
#in a case statement it uses I have this


	stop)
	RunApps Stop
	pkill -u $USER
	;;
well have you tried adding a command to that that does what you want?
Quote:
and yes it is a systemD ( blah ) system...
I have no explicit dbus starting commands in my startup file (~/.xinitrc in my case), but this instead:
Code:
if [ -d /etc/X11/xinit/xinitrc.d ]
then
  for f in /etc/X11/xinit/xinitrc.d/*
  do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi
which ultimately leads me to /etc/X11/xinit/xinitrc.d/50-systemd-user.sh:
Code:
#!/bin/sh

systemctl --user import-environment DISPLAY XAUTHORITY

if command -v dbus-update-activation-environment >/dev/null 2>&1; then
        dbus-update-activation-environment DISPLAY XAUTHORITY
fi
that's different from what you're using.

systemd is version 242.
 
Old 06-17-2019, 07:44 AM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by ondoho View Post
well have you tried adding a command to that that does what you want?
I have no explicit dbus starting commands in my startup file (~/.xinitrc in my case), but this instead:
Code:
if [ -d /etc/X11/xinit/xinitrc.d ]
then
  for f in /etc/X11/xinit/xinitrc.d/*
  do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi
which ultimately leads me to /etc/X11/xinit/xinitrc.d/50-systemd-user.sh:
Code:
#!/bin/sh

systemctl --user import-environment DISPLAY XAUTHORITY

if command -v dbus-update-activation-environment >/dev/null 2>&1; then
        dbus-update-activation-environment DISPLAY XAUTHORITY
fi
that's different from what you're using.

systemd is version 242.
this is using a login manager, LightDM.
that line is in my system too, if I remove that dbus I use for e16 then i lose automount and such.
LigntDM and dbus
Code:
FILE /etc/conf.d/xdm

DISPLAYMANAGER="lightdm"

To start LightDM on boot, add dbus and xdm to the default runlevel. dbus is necessary because LightDM depends on it to pass messages:
root #rc-update add dbus default
root #rc-update add xdm default

To start LightDM now:
root #/etc/init.d/dbus start
root #/etc/init.d/xdm start
systemd

To start LightDM on boot:
root #systemctl enable lightdm

To start LightDM now:
root #systemctl start lightdm
which I assume it already setup.

I also assume that if a user logs out and another logs in dbus should be taken care of on a user by user case basis, and which desktop if switched and is same user dbus should adjust itself accordingly. upon logging out and back in again to preform the desktop change. Which seems to not be the case here.

Last edited by BW-userx; 06-17-2019 at 07:50 AM.
 
Old 11-10-2019, 11:39 PM   #6
JustPassingBy
LQ Newbie
 
Registered: Nov 2018
Posts: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
Code:
#!/bin/sh
 
        # Start DBUS session bus:
        if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
        {
        eval `dbus-launch --sh-syntax --exit-with-session`
                echo "setting: $DBUS_SESSION_BUS_ADDRESS"
        export DBUS_SESSION_BUS_ADDRESS
        }
        else
                echo "alldone $DBUS_SESSION_BUS_ADDRESS"
        fi

        /usr/bin/starte16
This is mostly correct for my situation. However, --exit-with-session is designed to be used with an argument executable such as a session or window manager.

I used:
Code:
exec dbus-launch --exit-with-session fvwm >/tmp/wm.log 2>&1
to launch a window manager from my .xinitrc to fix a problem where the user dbus-daemon was still running after logout but applications couldn't connect to it after the next login. Terminals and such would take several seconds to timeout waiting for dbus, then start -- very annoying. dbus-daemon needs to die and restart with each session and this is the way when your display manager or other session management doesn't do it. I use SlIm configured to load .xinitrc after login, so I must handle each session myself. Very similar to the problem as outlined above.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to launch "cinnamon-session-cinnamon" X session "cinnamon-session-cinnamon" -found; Falling back to default "session." xxxindigo Linux Mint 22 09-01-2019 09:21 AM
Dbus error org.freedesktop.DBus.Error.NoReply whilie replying for file descriptor canitha Linux - Newbie 1 05-10-2017 07:36 AM
[SOLVED] using jack2-dbus, jack_control start gives error: DBus exception: org.jackaudio.Error Laertiades Linux - Newbie 7 05-10-2014 05:10 PM
dbus "rm /var/run/dbus/Desktop can't remove..." longus Slackware 6 12-15-2008 03:33 AM
Fedora Core 9 update dbus.exception & dbus.proxies & DBus.Error.AccessDenied errors trien27 Fedora 1 12-08-2008 11:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 10:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration