Como iniciar o dbus com um endereço fixo?

4

A questão diz respeito à mesma coisa que é descrita aqui e aqui , mas não vejo uma solução clara lá. Quer dizer, eu tenho o mesmo erro:

Failed to connect to socket /tmp/dbus-CwQMg2RxWx: Connection refused

e isso ocorre porque reiniciei minha sessão de caixa aberta sem reiniciar tmux . Gilles mencionou que eu deveria:

start dbus-daemon explicitly early in your X session startup and give it a fixed address like unix:path=~/.dbus-$HOSTNAME-$DISPLAY.

mas eu não sei onde colocar esse endereço.

Quando verifico processos dbus no meu sistema, recebo algo assim:

$ ps -eo user,group,args | grep -i dbus
morfik   morfik   ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-session
morfik   morfik   dbus-launch --sh-syntax --exit-with-session openbox-session
morfik   morfik   /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
message+ message+ /usr/bin/dbus-daemon --system
morfik   morfik   grep --color=auto -i dbus

Agora estou usando apenas o comando starx para iniciar o X-server, não uso mais o lightdm.

UPDATE # 1

Eu finalmente consegui iniciar o dbus com um endereço fixo. A linha deve ficar assim:

unix:path=/home/morfik/.dbus/.dbus-morfikownia-0

Não consegui usar : ou ~ no patch.

Mas há um problema.

Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] sink.c: Default and alternate sample rates are the same.
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-sink-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-sink-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-sink-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-sink-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-sink-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] source.c: Default and alternate sample rates are the same.
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-source-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-source-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-source-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-source-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [alsa-source-ca0106] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] module-console-kit.c: Unable to contact D-Bus system bus: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] module.c: Failed to load module "module-console-kit" (argument: ""): initialization failed.
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] main.c: Module load failed.
Feb 14 07:24:29 morfikownia pulseaudio[6979]: [pulseaudio] main.c: Failed to initialize daemon.

Agora, tenho os seguintes processos do dbus:

morfik:~$ ps -eo user,group,args | grep -i dbus
message+ message+ /usr/bin/dbus-daemon --system --address=unix:path=/home/morfik/.dbus/.dbus-morfikownia-0
morfik   morfik   dbus-launch --sh-syntax --exit-with-session openbox-session
morfik   morfik   /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
morfik   morfik   grep --color=auto -i dbus

Mas o DBUS_SESSION_BUS_ADDRESS ainda está sendo definido para um valor aleatório:

morfik:~$ env | grep -i dbus
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-W0pGpHoLOW,guid=20f83c74a8f5cef7e95ba8cb52fdb5cd

Eu mudei para

morfik:~$ export DBUS_SESSION_BUS_ADDRESS=unix:path=/home/morfik/.dbus/.dbus-morfikownia-0

para ver o que acontecerá e, para testes, usei xfce4-notifyd-config e ainda funciona. Então, verifiquei outro endereço:

morfik:~$ export DBUS_SESSION_BUS_ADDRESS=unix:path=/home/morfik/.dbus/.dbus-morfikownia-01

e deu o erro:

Failed to connect to socket /home/morfik/.dbus/.dbus-morfikownia-01: No such file or director

Eu coloquei a seguinte linha em /home/morfik/.config/openbox/environment :

export DBUS_SESSION_BUS_ADDRESS="unix:path=/home/morfik/.dbus/.dbus-morfikownia-0"

e eu posso iniciar xfce4-notifyd-config no tmux sem nenhum problema agora, mas o pulseaudio não funciona. Há também alguns outros problemas. Quando eu inicio o firefox, recebo o seguinte erro:

An error occurred while loading or saving configuration information for firefox. Some of your configuration settings may not work properly.

Failed to activate configuration server: The name org.gnome.GConf was not provided by any .service files

Failed to activate configuration server: The name org.gnome.GConf was not provided by any .service files

Failed to activate configuration server: The name org.gnome.GConf was not provided by any .service files

Failed to activate configuration server: The name org.gnome.GConf was not provided by any .service files

Portanto, a solução com --address funciona parcialmente e acho que isso causa mais mal do que bem. Talvez haja algo mais que precisa ser feito?

    
por Mikhail Morfikov 12.02.2014 / 20:24

1 resposta

1

dbus-daemon --address="unix:path=~/.dbus-$HOSTNAME-$DISPLAY"

Coloque isso no seu ~/.xinitrc se você usar startx, em ~/.xsession se você usar um gerenciador de login X gráfico com uma sessão customizada ou em qualquer script de shell que seu ambiente de área de trabalho seja executado quando for iniciado. Note que se o seu sistema iniciar com um daemon DBus, você pode precisar matá-lo primeiro. Isso pode afetar a funcionalidade de algum ambiente deskop.

Com essa configuração, todos os comandos do DBus se referem ao host onde o processo que está emitindo o comando está sendo executado, e não à GUI remota, se você estiver efetuando login via SSH com o encaminhamento do X11.

    
por 13.02.2014 / 00:19

Tags