unofficial mirror of guix-devel@gnu.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: Attila Lendvai <attila@lendvai.name>
Cc: Maya <maya@zenmaya.xyz>, "Ludovic Courtès" <ludo@gnu.org>,
	guix-devel@gnu.org
Subject: Re: Reproducer for  failing shepherd startup
Date: Mon, 12 Aug 2024 15:43:05 -0700	[thread overview]
Message-ID: <87v805bbwm.fsf@lease-up.com> (raw)
In-Reply-To: <7bBOkABsh2UGPl3R44IG9ReG-7b5Cgp6oh4l-exc7kU948GaaYpzXSI4GoDhYEBrCy3xNlwATA07IUagy5nnWzb2hd4wvN0ebe058AEwkkY=@lendvai.name>

[-- Attachment #1: Type: text/plain, Size: 4044 bytes --]

Hi Attila,

On Tue, Jul 02 2024, Attila Lendvai wrote:

> i forgot to add that it's fixed

Okay, then there is still another problem.  I am unable to reconfigure
my systems via 'guix deploy' when a timer is enabled already.  I am
trying to add a second timer.

The command stalls with messages like this:

    The following derivations will be built:
      /gnu/store/11nlp3k2lq25ijb4m9x0mj7phprjx9f6-remote-exp.scm.drv
      /gnu/store/b52aidm138l6nwk5wd7lr7ghk8x9n8bx-upgrade-shepherd-services.scm.drv
    
    building /gnu/store/b52aidm138l6nwk5wd7lr7ghk8x9n8bx-upgrade-shepherd-services.scm.drv...
    building /gnu/store/11nlp3k2lq25ijb4m9x0mj7phprjx9f6-remote-exp.scm.drv...
    guix deploy: sending 2 store items (0 MiB) to 'wallace-server.us-core.com'...

The issue occurred for the two timers below, but I believe the issue is
unrelated to the type of timer or their order.

Attached is a low-res image of the console output.  I was unable to
capture the error in any other way.  Sorry to spam the list with 7kB.

Kind regards
Felix

* * *

(define (garbage-collector-shepherd-service config)
  (shepherd-service
   (provision '(garbage-collector))
   (requirement '(guix-daemon))
   (modules '((shepherd service timer)))
   (start #~(make-timer-constructor
             ;; Five minutes after midnight every day.
             (calendar-event #:hours '(0) #:minutes '(5))
             (command (list #$(file-append guix "/bin/guix")
                            "gc"
                            "--free-space=1G"))))
   (stop #~(make-timer-destructor))
   (actions
    (list (shepherd-action
           (name 'trigger)
           (documentation "Trigger the action associated with this timer.")
           (procedure #~(identity trigger-timer)))))
   (documentation "Maintain minimum free space by cleaning up Guix garbage")))

(define garbage-collector-service-type
  (service-type
   (name 'garbage-collector)
   (description
    "Maintain minimum free space by cleaning up Guix garbage")
   (extensions
    (list
     (service-extension shepherd-root-service-type
                        (compose list garbage-collector-shepherd-service))))
   (default-value #f)))

(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)))


[-- Attachment #2: Shepherd Timers Reload Error Message --]
[-- Type: image/jpeg, Size: 7077 bytes --]

  reply	other threads:[~2024-08-12 22:43 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     ` Reproducer for " Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-06-28 16:43       ` 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. [this message]
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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87v805bbwm.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).