Subject: Re: bug#63982: Shepherd can crash when a user service fails to start

From: Ludovic Courtès <[email-masked]>
Date: Thu, 22 Jun 2023 22:08:56 +0200

Hi,

[email-masked] skribis:

> 0.10.99:
> Starting service root...
> Service root started.
> Service root running with value #t.
> Service root has been started.
> WARNING: Use of `load' in declarative module (#{ g119}#).  Add #:declarative? #f to your define-module invocation.
> Uncaught exception while loading configuration file '/gnu/store/w6rlja8v65dwv16ivcqx513q7827n6aq-shepherd.conf': (wrong-type-arg "string-append" "Wrong type (expecting ~A): ~S"
>  ("string" #f) (#f))
>
> , and then the reconfiguration hangs. /run/user/1000/shepherd/socket is created, and herd status shows that root is started, other services are not shown, and are not started.
>
>
> Content of config (/gnu/store/w6rlja8v65dwv16ivcqx513q7827n6aq-shepherd.conf):
> (begin (use-modules (srfi srfi-34) (system repl error-handling)) (apply register-services (map (lambda (file) (load file)) (quote ("/gnu/store/71n4r0hccps574aqcks7zyk5rz5zardq-
> shepherd-eww.scm" "/gnu/store/0r14z4psnf9h2nfqiflm0nv6m2bv04si-shepherd-eww-open-lockscreen-like-background.scm" "/gnu/store/ylidynn5akvk3lmqrxbgqkz0c8hn3y8c-shepherd-syncthing
> .scm" "/gnu/store/9igwbpbwavl6r94ph7qss7i5cqq9d8nj-shepherd-mcron.scm")))) (action (quote root) (quote daemonize)) (format #t "Starting services...~%") (let ((services-to-start
> (quote (eww eww-open-lockscreen-like-background syncthing mcron)))) (if (defined? (quote start-in-the-background)) (start-in-the-background services-to-start) (for-each start
> services-to-start)) (redirect-port (open-input-file "/dev/null") (current-input-port))))

This suggests a problem in the config file: one of the shepherd-*.scm
files listed above ends up calling (string-append #f …).

We’d need to see those files to understand what’s happening but it looks
different from what Maxim reported.

Thanks,
Ludo’.