GNU bug report logs -
#77610
guix-daemon socket activation does not work on the hurd
Previous Next
Reported by: yelninei <at> tutamail.com
Date: Mon, 7 Apr 2025 16:30:03 UTC
Severity: normal
Done: Ludovic Courtès <ludo <at> gnu.org>
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
yelninei--- via Bug reports for GNU Guix <bug-guix <at> gnu.org> writes:
> After mentioning this on IRC Ludovic pushed 8d31cafbdcb818160852a5d1e6fc24c1a9c53e41 to the shepherd repo.
>
> I wanted to try this out and reconfigured using the shepherd from this commit as pid1 in the vm (a bit tricky because of help2man).
>
> The first connection still fails in the same way.unexpected build daemon error: reading from file: Resource temporarily unavailable
I looked a bit into this, and I think shepherd is doing the right
working as expected, making the socket blocking before executing
guix-daemon (it’s clear when stracing it on Linux).
So there must be something specific at play on the Hurd.
I tried this snippet (server on one side, client on the other side) and
it works as expected: ‘accept’ blocks and subsequent read does not get
EAGAIN.
So I’m at loss here. Does ‘tests/systemd.sh’ succeed when ran natively?
(In particular the check added in
8d31cafbdcb818160852a5d1e6fc24c1a9c53e41.)
Thanks,
Ludo’.
[non-blocking-hurd.scm (text/plain, inline)]
(use-modules (ice-9 match))
(define (blocking-port port)
"Return PORT after putting it in non-blocking mode."
(let ((flags (fcntl port F_GETFL)))
(fcntl port F_SETFL (logand (lognot O_NONBLOCK) flags))
port))
(let ((sock (socket AF_UNIX (logior SOCK_STREAM SOCK_NONBLOCK) 0)))
(bind sock AF_UNIX "/tmp/sock")
(listen sock 10)
(match (pk 'x (accept (blocking-port sock) SOCK_CLOEXEC)) ;should block
((port . _)
(pk 'read (read port)))))
;; Client:
(let ((sock (socket AF_UNIX (logior SOCK_STREAM) 0)))
(connect sock AF_UNIX "/tmp/sock")
(display "hi!\n" sock))
This bug report was last modified 27 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.