guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Upgrading Shepherd services


From: Felix Lechner
Subject: Re: Upgrading Shepherd services
Date: Wed, 22 May 2024 19:04:59 -0700

Hi Attila,

On Fri, May 17 2024, Attila Lendvai wrote:

> if you do have a reproducer

Here is a small one for not booting, although the service activation
during 'guix deploy' succeeds.

Please try the Guix timer below with the Shepherd development branch.
My equipment does not boot when the apparently erroneous (actions ...)
field in the shepherd-service record is present.

King regards,
Felix

P.S. Advice on how to access the trigger would be welcome.

* * *

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]