all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Felix Lechner via "Development of GNU Guix and the GNU System distribution." <guix-devel@gnu.org>
To: Maya <maya@zenmaya.xyz>, "Ludovic Courtès" <ludo@gnu.org>,
	"Attila Lendvai" <attila@lendvai.name>
Cc: guix-devel@gnu.org
Subject: Reproducer for  failing shepherd startup
Date: Fri, 28 Jun 2024 08:17:41 -0700	[thread overview]
Message-ID: <8734oxw0yy.fsf@lease-up.com> (raw)
In-Reply-To: <874j9el2r1.fsf@zenmaya.xyz>

Hi Maya, Ludo' and Attila,

On Thu, Jun 27 2024, Maya wrote:

> I still don't know how to fix the issue properly, but at least I can
> reconfigure my system now <3

I have a reproducer!  In the code below, please change "sunday" to "0",
together with this line in your "services":

     (service mdadm-resync-service-type)

When reconfiguring, you should see something like:

    guix deploy: warning: an error occurred while upgrading services on
    'YOUR-FQDN': %exception #<inferior-object #<&action-exception-error
    service: root action: eval key: %exception args: ("#<&message
    message: \"calendar-event: 0: invalid day of week\">")>>

That system should refuse to boot.  Interestingly, the Shepherd will
block in such a way that even the Magic SysRq key 'i' which is normally
enough will not stop it.  I have to go all the way *backwards* to 'b' in
the sequence B-U-S-I-E-R. [1]

Ludo', thank you for making the #:days-of the week symbolic [2] and also
for fixing the Shepherd to be able to show status and reboot again! [3]

Kind regards
Felix

[1] https://lists.gnu.org/archive/html/guix-devel/2024-04/msg00214.html
[2] https://git.savannah.gnu.org/cgit/shepherd.git/commit/?h=devel&id=2e844430ec8aa4aebb7a8c185f54d6f91bbc3cfe
[3] https://lists.gnu.org/archive/html/info-gnu/2024-06/msg00009.html

* * *

(define (mdadm-resync-shepherd-service config)
  (shepherd-service
   (provision '(mdadm-resync))
   (requirement '(file-systems user-processes))
   (modules '((ice-9 ftw)
              (ice-9 regex)
              (shepherd service timer)))
   (start #~(make-timer-constructor
             ;; Every first Sunday of the month at 1 AM.
             (calendar-event #:days-of-month '(1 2 3 4 5 6 7)
                             #:days-of-week '(sunday)
                             #:hours '(1))
             (lambda _
               ;; some helpers and error handling
               (define (info message)
                 (let ((timestamp (strftime "%Y-%m-%dT%H:%M:%S%zZ" (localtime (current-time)))))
                   (format (current-error-port) "~a ~a~%" timestamp message)))

               (define (resync array)
                 (let ((port (open-output-file (string-append "/sys/block/" array "/md/sync_action"))))
                   (display "check" port)
                   (close-port port))
                 (info (string-append "Started MD resync for " array ".")))

               (let* ((is-mdadm-device? (lambda (file)
                                          (string-match "^md.+" file)))
                      (arrays (scandir "/dev" is-mdadm-device?)))
                 (map resync arrays)))))
   (stop #~(make-timer-destructor))
   ;; (actions
   ;;  (list (shepherd-action
   ;;         (name 'trigger)
   ;;         (documentation "Trigger the action associated with this timer.")
   ;;         (procedure #~(identity trigger-timer)))))
   (documentation "MD array resync")))

(define mdadm-resync-service-type
  (service-type
   (name 'mdadm-resync)
   (description "MD array resync")
   (extensions
    (list
     (service-extension shepherd-root-service-type
                        (compose list mdadm-resync-shepherd-service))))
   (default-value #f)))


  reply	other threads:[~2024-06-28 15:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-21 13:27 Debugging failing shepherd startup maya
2024-06-21 20:32 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-06-27 13:07 ` Ludovic Courtès
2024-06-27 17:22   ` Maya
2024-06-28 15:17     ` Felix Lechner via Development of GNU Guix and the GNU System distribution. [this message]
2024-06-28 16:43       ` Reproducer for " Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-07-02 13:03       ` Attila Lendvai
2024-07-02 13:11         ` Attila Lendvai
2024-08-12 22:43           ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-08-13 13:46             ` Shepherd calendar event bug Ludovic Courtès
2024-08-16 19:13               ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-08-21 17:30                 ` Ludovic Courtès
2024-08-23 16:38                   ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-09-16 13:27             ` Reproducer for failing shepherd startup Attila Lendvai
2024-09-17  1:11               ` Felix Lechner via Development of GNU Guix and the GNU System distribution.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734oxw0yy.fsf@lease-up.com \
    --to=guix-devel@gnu.org \
    --cc=attila@lendvai.name \
    --cc=felix.lechner@lease-up.com \
    --cc=ludo@gnu.org \
    --cc=maya@zenmaya.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.