GNU bug report logs - #52654
shepherd hangs whole system upon encountering error in start slot

Previous Next

Package: guix;

Reported by: raingloom <raingloom <at> riseup.net>

Date: Sun, 19 Dec 2021 05:14:02 UTC

Severity: important

Full log


Message #15 received at 52654 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: raingloom <raingloom <at> riseup.net>
Cc: 52654 <at> debbugs.gnu.org
Subject: Re: bug#52654: shepherd lacks error reporting
Date: Sat, 29 Apr 2023 11:22:27 -0400
Hi,

I also encountered that issue, it's really puzzling.

Here's the problematic start slot that got my mpd test to hang the boot,
with the last message being "Please wait while gathering entropy to
generate the key pair;":

--8<---------------cut here---------------start------------->8---
(start
        (with-imported-modules (source-module-closure
                                '((gnu build activation)))
          #~(begin
              (use-modules (gnu build activation))

              (let ((user (getpw #$username)))

                (define (init-directory directory)
                  (unless (file-exists? directory)
                    (mkdir-p/perms directory user #o755)))

                (for-each
                 init-directory
                 (cons '#$(map dirname
                               ;; XXX: Delete the potential "syslog"
                               ;; log-file value, which is not a directory.
                               (delete "syslog"
                                       (filter-map maybe-value
                                                   (list db-file
                                                         log-file
                                                         state-file
                                                         sticker-file)))))))

              (make-forkexec-constructor
               (list #$(file-append package "/bin/mpd") "--no-daemon"
                     #$config-file)
               #:environment-variables '#$environment-variables))))
--8<---------------cut here---------------end--------------->8---

The error was the lonely cons.  Taking it out, the test then passed:

--8<---------------cut here---------------start------------->8---
(start
        (with-imported-modules (source-module-closure
                                '((gnu build activation)))
          #~(begin
              (use-modules (gnu build activation))

              (let ((user (getpw #$username)))

                (define (init-directory directory)
                  (unless (file-exists? directory)
                    (mkdir-p/perms directory user #o755)))

                (for-each
                 init-directory
                 '#$(map dirname
                         ;; XXX: Delete the potential "syslog"
                         ;; log-file value, which is not a directory.
                         (delete "syslog"
                                 (filter-map maybe-value
                                             (list db-file
                                                   log-file
                                                   state-file
                                                   sticker-file))))))

              (make-forkexec-constructor
               (list #$(file-append package "/bin/mpd") "--no-daemon"
                     #$config-file)
               #:environment-variables '#$environment-variables))))
--8<---------------cut here---------------end--------------->8---

Shepherd should report the error, fail that one service and attempt to
keep booting (if the service is not required by other critical ones).

-- 
Thanks,
Maxim




This bug report was last modified 2 years and 47 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.