0

I'm trying to build a tcp proxy to my local session dbus daemon. I did

 socat TCP-LISTEN:55556,reuseaddr,fork,range=127.0.0.1/32 ABSTRACT-CONNECT:/run/user/1000/bus

However, DBUS_SESSION_BUS_ADDRESS=tcp:host=127.0.0.1,port=55556 notify-send hello gives this error

2018/12/31 03:11:56 socat[4316] E connect(5, AF=1 "\0/run/user/1000/bus", 21): Connection refused
2018/12/31 03:11:56 socat[4317] E connect(5, AF=1 "\0/run/user/1000/bus", 21): Connection refused

How can I fix that? I don't care about security issues at all since this is a offline box.

0

You should verify with ss -xnl that the unix socket is displayed beginning with @ to make it an abstract socket. I'm betting there's no such @. I have two systems running quite different versions. One is listening with abstract sockets with random entries like @/tmp/dbus-QVAhTtSPNB the other is listening with unix (non abstract) sockets with /run/user/1000/bus.

The correct command is probably:

 socat TCP-LISTEN:55556,reuseaddr,fork,range=127.0.0.1/32 UNIX-CONNECT:/run/user/1000/bus
  • After switching to UNIX-CONNECT, the dbus request is silently dropped as if there isn't a dbus service available. – Amos Dec 31 '18 at 7:37
  • @Amos Running your setup with my solution, but using dbus-monitor instead of notify-send hello gets me a whole dump of information from to dbus – A.B Dec 31 '18 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.