opendht-service-type hangs Shepherd at boot

DoneSubmitted by Maxim Cournoyer.
Details
One participant
  • Maxim Cournoyer
Owner
unassigned
Severity
normal
M
M
Maxim Cournoyer wrote on 19 May 13:59 +0200
(name . bug-guix)(address . bug-guix@gnu.org)
874kezhr3c.fsf@gmail.com
Hello,
I just noticed about this problem following a reboot. I can alsoreproduce it in 'guix system vm', simply adding the opendht-service-typeto my operating-system declaration.
The boot proceeds until 'error in finalization thread: Success' thenhangs indefinitely.
What is troubling for me is that the service is rather straightforwardlydefined. It uses the make-forkexec-constructor/container like so:
Toggle snippet (15 lines)(define (opendht-shepherd-service config) "Return a <shepherd-service> running OpenDHT." (shepherd-service (documentation "Run an OpenDHT node.") (provision '(opendht dhtnode dhtproxy)) (requirement '(user-processes syslogd)) (start #~(make-forkexec-constructor/container (list #$@(opendht-configuration->command-line-arguments config)) #:mappings (list (file-system-mapping (source "/dev/log") ;for syslog (target source))) #:user "opendht")) (stop #~(make-kill-destructor))))
I'm not sure how using such basic building blocks could lead to a hangin Shepherd ?
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 19 May 23:36 +0200
(address . 48521@debbugs.gnu.org)
87zgwqh0d5.fsf@gmail.com
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
Toggle quote (29 lines)> Hello,>> I just noticed about this problem following a reboot. I can also> reproduce it in 'guix system vm', simply adding the opendht-service-type> to my operating-system declaration.>> The boot proceeds until 'error in finalization thread: Success' then> hangs indefinitely.>> What is troubling for me is that the service is rather straightforwardly> defined. It uses the make-forkexec-constructor/container like so:>> (define (opendht-shepherd-service config)> "Return a <shepherd-service> running OpenDHT."> (shepherd-service> (documentation "Run an OpenDHT node.")> (provision '(opendht dhtnode dhtproxy))> (requirement '(user-processes syslogd))> (start #~(make-forkexec-constructor/container> (list #$@(opendht-configuration->command-line-arguments config))> #:mappings (list (file-system-mapping> (source "/dev/log") ;for syslog> (target source)))> #:user "opendht"))> (stop #~(make-kill-destructor))))>> I'm not sure how using such basic building blocks could lead to a hang> in Shepherd ?
After much trial and error, the service can be made to not hang Shepherdwith the removal of the mappings argument:
Toggle snippet (15 lines)modified gnu/services/networking.scm@@ -845,9 +845,9 @@ CONFIG, an <opendht-configuration> object." (requirement '(user-processes networking syslogd)) (start #~(make-forkexec-constructor/container (list #$@(opendht-configuration->command-line-arguments config))- #:mappings (list (file-system-mapping- (source "/dev/log") ;for syslog- (target source)))+ ;; #:mappings (list (file-system-mapping+ ;; (source "/dev/log") ;for syslog+ ;; (target source))) #:user "opendht")) (stop #~(make-kill-destructor))))
I have no idea why that is, but given that the tor-service-type does thesame thing, I can only conclude that it is some strange interactionbetween dhtnode and syslog.
The above fixes the hang, but breaks logging to syslog.
Ideas?
Maxim
M
M
Maxim Cournoyer wrote on 20 May 04:52 +0200
(address . 48521-done@debbugs.gnu.org)
87v97eglrd.fsf@gmail.com
Hello,
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
Toggle quote (29 lines)> Hello,>> I just noticed about this problem following a reboot. I can also> reproduce it in 'guix system vm', simply adding the opendht-service-type> to my operating-system declaration.>> The boot proceeds until 'error in finalization thread: Success' then> hangs indefinitely.>> What is troubling for me is that the service is rather straightforwardly> defined. It uses the make-forkexec-constructor/container like so:>> (define (opendht-shepherd-service config)> "Return a <shepherd-service> running OpenDHT."> (shepherd-service> (documentation "Run an OpenDHT node.")> (provision '(opendht dhtnode dhtproxy))> (requirement '(user-processes syslogd))> (start #~(make-forkexec-constructor/container> (list #$@(opendht-configuration->command-line-arguments config))> #:mappings (list (file-system-mapping> (source "/dev/log") ;for syslog> (target source)))> #:user "opendht"))> (stop #~(make-kill-destructor))))>> I'm not sure how using such basic building blocks could lead to a hang> in Shepherd ?
It seems Shepherd can't cope with a failing start procedure/script whena variable was not bound. To diagnose the problem, the best way endedup being to extract the code of the constructor in a separate script torun it separately. This made the error quickly apparent: "Unboundvariable: file-system-mapping".
We should try to handle this class of errors in Shepherd and report auseful message and *not* crash Shepherd or otherwise hang.
Pushed with commit a09cdf1f9d.
Closing.
Maxim
Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send email to 48521@debbugs.gnu.org