graysky2 / profile-sync-daemon

Symlinks and syncs browser profile dirs to RAM thus reducing HDD/SDD calls and speeding-up browsers.
https://wiki.archlinux.org/index.php/Profile-sync-daemon
Other
910 stars 88 forks source link

Start psd and get "failed to connect to bus" #147

Closed yangsheng6810 closed 9 years ago

yangsheng6810 commented 9 years ago

I installed profile-sync-daemon with AUR, when trying to start it with systemctl --user start psd.service or sudo systemctl --user start psd.service, I get the following: Failed to connect to bus: No such file of directory I looked into the service file and /usr/bin/psd file, but saw nothing about d-bus. wiki.archlinux.org provides some information on systemd with d-bus, but they are not helpful. I can run /usr/bin/psd directly, and it tells me to it through systemd. Is there any way that I can overcome this problem? I am willing to help debugging it, but cannot find any log from systemd nor from /usr/bin/psd

graysky2 commented 9 years ago

What is the output of:

echo $XDG_RUNTIME_DIR
echo $DBUS_SESSION_BUS_ADDRESS
systemctl status dbus.service
yangsheng6810 commented 9 years ago

echo $XDG_RUNTIME_DIR: /run/user/1000 echo $DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus systemctl -l status dbus.service :

● dbus.service - D-Bus System Message Bus
   Loaded: loaded (/usr/lib/systemd/system/dbus.service; static; vendor preset: disabled)
   Active: active (running) since 一 2015-10-19 09:53:19 EDT; 5h 57min ago
     Docs: man:dbus-daemon(1)
 Main PID: 680 (dbus-daemon)
   CGroup: /system.slice/dbus.service
           ├─ 680 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
           └─5514 /usr/bin/python /usr/share/backintime/qt4/serviceHelper.py

10月 19 14:22:30 myhost dbus[680]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
10月 19 14:50:32 myhost dbus[680]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
10月 19 14:50:32 myhost dbus[680]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
10月 19 14:51:02 myhost systemd[1]: Started D-Bus System Message Bus.
10月 19 15:18:25 myhost dbus[680]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
10月 19 15:18:25 myhost dbus[680]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
10月 19 15:46:36 myhost dbus[680]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
10月 19 15:46:36 myhost dbus[680]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
10月 19 15:48:25 myhost dbus[680]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
10月 19 15:48:25 myhost dbus[680]: [system] Successfully activated service 'org.freedesktop.hostname1'
graysky2 commented 9 years ago

That seems right... I am not a systemd expert, but I have experienced a system that did something similar. I assumed that I did something to screw it up and tested a fresh install on a new partition as a sanity check. I was surprised to see that everything works as expected there and just reinstalled.

https://bbs.archlinux.org/viewtopic.php?id=201543

What happens if you run:

systemd-run --user /bin/sleep 10
yangsheng6810 commented 9 years ago

If i run systemd-run --user /bin/sleep 10 with normal user, I get Running as unit run-14213.service., but if I run it with root permission, sudo systemd-run --user /bin/sleep 10, I get Failed to create bus connection: No such file or directory. Does using sudo make any differences? And what do you mean by reinstalling? reinstalling systemd or dbus?

graysky2 commented 9 years ago

You shouldn't need to run either psd or that command as the root user... are you running psd with a sudo prefix? If so, don't :relaxed:

If you are running psd without the sudo and still experiencing the problem, I am not sure what to tell you since the psd service works on many machines. To answer your question, in my case, I reinstalled the system and everything just worked, so I concluded that I must have tweaked a setting or two that prevented things from working as expected.

Try this:

1) Reboot 2) Type systemctl --user start psd (no sudo).

What is the output?

yangsheng6810 commented 9 years ago

Sorry for the previous comment. I find a weird alias alias systemctl='sudo systemctl' in my .zshrc, which I have no idea why it is there. Removing it, I start to receive an error of Failed to start psd.service: Process org.freedesktop.systemd1 exited with status 1. I will look into the logs and google for some solution. Sorry for disturbing you. Do you think it is a good idea to close this issue? Thank you for all of your patience

graysky2 commented 9 years ago

OK... what if you circumvent the alias by:

/usr/bin/systemctl --user start psd

Does that return the same org.freedesktop.systemd1 error?

yangsheng6810 commented 9 years ago

I removed the alias, and starts getting Failed to start psd.service: Process org.freedesktop.systemd1 exited with status 1. The weird thing is that, if i run the following, I will get something which I believe to show some problem: echo $XDG_RUNTIME_DIR ` echo $DBUS_SESSION_BUS_ADDRESS unix:abstract=/tmp/dbus-9xTLKBl1bt,guid=11421a35e238ea005376c1b85625531c systemctl -l status dbus.service`

● dbus.service - D-Bus System Message Bus
   Loaded: loaded (/usr/lib/systemd/system/dbus.service; static; vendor preset: disabled)
   Active: active (running) since 一 2015-10-19 16:29:54 EDT; 26min ago
     Docs: man:dbus-daemon(1)
 Main PID: 733 (dbus-daemon)
   CGroup: /system.slice/dbus.service
           ├─ 733 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
           └─5265 /usr/bin/python /usr/share/backintime/qt4/serviceHelper.py

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

Maybe an explanation would be that I manually started some dbus related service in trying to solve the problem, and I got the correct output. After my reboot, whthout all those manually started services, I get error?

yangsheng6810 commented 9 years ago

I used the following from your link and solved the problem.

export XDG_RUNTIME_DIR="/run/user/$UID"
export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"

I will reboot to see if this solution is consistent.

yangsheng6810 commented 9 years ago

I confirm it is working now, and the speed of firefox now is just awesome! Thank you a lot for your patience and your great work of profile-sync-daemon! // though the first reboot failed and I reboot it a second time. This should have nothing to do with psd. I will solve it myself some day, if it ever occurs again.

graysky2 commented 9 years ago

Glad it is working for you now.

On Monday, October 19, 2015, yangsheng6810 notifications@github.com wrote:

I removed the alias, and starts getting Failed to start psd.service: Process org.freedesktop.systemd1 exited with status 1. The weird thing is that, if i run the following, I will get something which I believe to show some problem: echo $XDG_RUNTIME_DIR

echo $DBUS_SESSION_BUS_ADDRESS unix:abstract=/tmp/dbus-9xTLKBl1bt,guid=11421a35e238ea005376c1b85625531c systemctl -l status dbus.service

● dbus.service - D-Bus System Message Bus Loaded: loaded (/usr/lib/systemd/system/dbus.service; static; vendor preset: disabled) Active: active (running) since 一 2015-10-19 16:29:54 EDT; 26min ago Docs: man:dbus-daemon(1) Main PID: 733 (dbus-daemon) CGroup: /system.slice/dbus.service ├─ 733 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation └─5265 /usr/bin/python /usr/share/backintime/qt4/serviceHelper.py

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

Maybe an explanation would be that I manually started some dbus related service in trying to solve the problem, and I got the correct output. After my reboot, whthout all those manually started services, I get error?

— Reply to this email directly or view it on GitHub https://github.com/graysky2/profile-sync-daemon/issues/147#issuecomment-149345760 .

Sent from Gmail Mobile