Repository navigation
Closed
Labels
Description
Well, first I can't start it normally because PID 1 isn't really upstart, and nothing's listening on the upstart socket:
# service dbus start
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
But even if I start the D-Bus daemon manually, like this:
# mkdir -p /run/dbus
# chown messagebus:messagebus /run/dbus
# dbus-uuidgen --ensure
# dbus-daemon --system --fork
# ls -l /run/dbus/
ls: /run/dbus/system_bus_socket: Invalid argument
total 0
-rw-r--r-- 1 root root 5 May 15 13:12 pid
srwxrwxrwx 1 root root 0 May 15 13:12 system_bus_socket
It doesn't respond as I'd expect it to when I try to interact with the message bus:
# dbus-monitor --system --monitor
Failed to open connection to system bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
It looks like a sendmsg breaks somehow (below output wrapped at 80 columns for readability, because GitHub just adds a scrollbar otherwise, and makes the return value annoying to find):
# strace -s 65535 -f dbus-monitor --system --monitor | fold -w 80
strace: Test for PTRACE_O_TRACESYSGOOD failed, giving up using this feature.
execve("/usr/bin/dbus-monitor", ["dbus-monitor", "--system", "--monitor"], [/* 7
0 vars */]) = 0
[ ... trimmed out shared library loads and program initialization ... ]
socket(PF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/dbus/system_bus_socket"}, 33)
= 0
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
geteuid() = 0
getsockname(3, {sa_family=AF_LOCAL, NULL}, [2]) = 0
poll([{fd=3, events=POLLOUT}], 1, 0) = 1 ([{fd=3, revents=POLLOUT}])
sendto(3, "\0", 1, MSG_NOSIGNAL, NULL, 0) = 1
sendto(3, "AUTH EXTERNAL 30\r\n", 18, MSG_NOSIGNAL, NULL, 0) = 18
poll([{fd=3, events=POLLIN}], 1, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
read(3, "OK 99eed480d5eda4f5f283f0425738d840\r\n", 2048) = 37
poll([{fd=3, events=POLLOUT}], 1, 4294967295) = 1 ([{fd=3, revents=POLLOUT}])
sendto(3, "NEGOTIATE_UNIX_FD\r\n", 19, MSG_NOSIGNAL, NULL, 0) = 19
poll([{fd=3, events=POLLIN}], 1, 4294967295) = 1 ([{fd=3, revents=POLLIN}])
read(3, "AGREE_UNIX_FD\r\n", 2048) = 15
poll([{fd=3, events=POLLOUT}], 1, 4294967295) = 1 ([{fd=3, revents=POLLOUT}])
sendto(3, "BEGIN\r\n", 7, MSG_NOSIGNAL, NULL, 0) = 7
poll([{fd=3, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=3, revents=POLLOU
T}])
sendmsg(3, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\0\1\0\0\0\0\1\0\0\0n\0\0\0\1\1o\
0\25\0\0\0/org/freedesktop/DBus\0\0\0\6\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\
0\2\1s\0\24\0\0\0org.freedesktop.DBus\0\0\0\0\3\1s\0\5\0\0\0Hello\0\0\0", 128},
{"", 0}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = -1 EINVAL (Invalid arg
ument)
close(3) = 0
clock_gettime(CLOCK_MONOTONIC, {2738, 696180000}) = 0
write(2, "Failed to open connection to system bus: Did not receive a reply. Poss
ible causes include: the remote application did not send a reply, the message bu
s security policy blocked the reply, the reply timeout expired, or the network c
onnection was broken.\n", 252Failed to open connection to system bus: Did not re
ceive a reply. Possible causes include: the remote application did not send a re
ply, the message bus security policy blocked the reply, the reply timeout expire
d, or the network connection was broken.
) = 252
exit_group(1) = ?
<... exit_group resumed> _exit returned!
) = ? ([{fd=3, revents=POLLOUT}])
+++ exited with 1 +++
Reacted by Caio Quirino da Silva, Federico, Leo Gallucci, Emma Worley, Tatsuro Hisamori, Taka Turgut, sunyinqi0508, David Zerrenner, Vũ Văn Dũng, Yukun Guo and 2 more
Activity
benhillis commentedon May 15, 2016
Thanks for reporting, dbus is on our feature backlog. I took a look at your repro and it looks like there's a fair amount of missing surface area in our socket implementation to get dmsg working correctly. I've add details to our internal bug.
sunilmut commentedon May 15, 2016
Steven Noonan (@tycho) - Apart from what Ben Hillis (@benhillis) has mentioned, the specific problem here is that our UNIX socket sendmsg implementation does not handle an IO vector length of > 1. Thanks for the trace, they are almost always useful.
aseering commentedon May 15, 2016
For reference / in case it saves anyone else time: dbus can be configured to use TCP instead of UNIX domain sockets. Unfortunately (though unsurprisingly), doing so doesn't help;
straceindicates that it hits the same issue withsendmsg(..., msg_iov(2)=...).sunilmut commentedon May 16, 2016
Yes, INET sockets also lack this capability as you have discovered :). I have opened a bug to track the support for IO vector length > 1 for sendmsg/recvmsg.
lateau commentedon Jun 10, 2016
Paths are incorrect in /etc/init.d/dbus.
Actually,
arcanis commentedon Aug 7, 2016
Has something changed on this issue? After reading this Reddit thread I tried switching dbus configuration to use tcp sockets instead of unix sockets, but unfortunately despite no apparent network errors I still ran into some issues:
Here is the full strace: http://sprunge.us/NYYM. Apparently, dbus still looked for a file named
/var/run/dbus/system_bus_socket.sunilmut commentedon Aug 24, 2016
With better support for AF_LOCAL socket, dbus seems to be happy and the dbus workarounds to use TCP sockets will hopefully no longer be needed. The changes haven't made it to the release branch yet, but are moving fast. Keep an eye out on the release notes.
wench commentedon Oct 1, 2016
DBUS is triggering the socket related BSOD in 14936. Makes it completely unusable.
sunilmut commentedon Oct 3, 2016
Alexis Ryan (@wench) The fix for the BSOD is coming soon. Apologize for the inconvenience.
wench commentedon Oct 4, 2016
Maybe i should prod/beg Dona and get her to release a build that has it fixed
5 remaining items
sunilmut commentedon Apr 20, 2017
@Benqzq - Thanks for the report. Can you try
/etc/init.d/dbus startand then rerun your repro? Also, which windows build are you running? You can dump the output of thevercommand from a Windows command prompt.sunilmut commentedon Apr 21, 2017
@Benqzq - No, no! Just what is failing, if there are any specific scenario that is failing for you.
sunilmut commentedon Apr 21, 2017
Ok. If you see that error happen again for a specific scenario, you can try the steps above.
sunilmut commentedon Apr 23, 2017
@Benqzq - Glad to know that its working for you now. Your understanding is correct. Currently, WSL doesn't "boot" per se, i.e. it doesn't start the default services that you would find in Linux such as
dbus. It is also closely tied to the lack of support fordaemon. You can see the corresponding User Voice page here. We are looking into some of these bigger problems, but, we don't have an ETA at the moment.kuncevic commentedon Nov 23, 2017
Just installed the WSL on my windows 10:
lsb_release -a:Was following the docker tutorial and it is failing on the last step
sudo systemctl status dockererroring withAnd as result of that cant run
docker-compose buildsayingWhen running
docker run hello-worlderroring withUPDATE: Setting the

“Expose daemon on tcp://localhost:2375 without TLS”did helpso all good now.
also I did setup an alias to docker host
archon810 commentedon Feb 12, 2018
Fresh install of OpenSuse (42.3) WSL. Tons of error messages about dbus.
etc.
therealkenc commentedon Feb 12, 2018
No systemctl on WSL. Landing zone is #994. Unrelated to dbus.
archon810 commentedon Feb 13, 2018
therealkenc The question is what does rpm run when it has extra jobs to do after the installation. Is it also systemctl or something else?
therealkenc commentedon Mar 11, 2018
Artem Russakovskii (@archon810) - missed your question. I don't use rpm based distros (much) but I gather at least SUSE 42 uses systemctl at least sometimes per #2941.
rpmdoesn't "run"systemctlper se. It depends on how the package maintainers decide to implement their postinstall scripts, based on whatever their platform (Ubuntu, SUSE, Fedora) prefers. For some definition of prefer. The meaning of "package maintainers" here is kind of fluid. Some upstream packages are fairly wed tosystemd(withdbusand the rest). Others, less so. The distribution package maintainers try to bring the differences into some kind of semi-coherency.6d61726b760a commentedon Mar 30, 2023
the following solution worked for me:
https://x410.dev/cookbook/wsl/sharing-dbus-among-wsl2-consoles/
the only downside is having to put my password in a script.
Biswa96 commentedon Mar 30, 2023
systemd works in WSL2 from Windows Store. You do not need those kind of workaround anymore. See this article for more details https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/