bug-guix
[Top][All Lists]
Advanced

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

bug#62163: Suppress logging shepherd evaluation in mcron.log


From: Ludovic Courtès
Subject: bug#62163: Suppress logging shepherd evaluation in mcron.log
Date: Thu, 30 Mar 2023 12:22:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi,

Bruno Victal <mirai@makinata.eu> skribis:

> On 2023-03-28 17:25, Ludovic Courtès wrote:
>> 
>> Nope. :-)  What is ‘my-heartbeat-job’ doing?
>
> It queries shepherd to see if a service is running and sends a restart if 
> required.

Isn’t that what #:respawn? #t is supposed to do?  :-)

If you find that #:respawn? doesn’t work, then we should fix it.

> (define* (heartbeat-supervisor #:key (name #f) service task
>                                #:allow-other-keys)
>   ;; Query service status and restart if needed.
>   (program-file
>    (format #f "~@[~a-~]heartbeat-supervisor.scm" name)
>    (with-imported-modules (source-module-closure
>                            '((gnu services herd)))
>      #~(begin
>          (use-modules (gnu services herd)
>                       (srfi srfi-1))
>
>          (define (is-service-running? sym)
>            (lambda (x)
>              (and (live-service-running x)
>                   (memq sym (live-service-provision x)))))
>
>          (let ((running? (not (null?
>                                (any (is-service-running? '#$service)
>                                     (current-services))))))

You can send messages to the bitbucket with:

  (parameterize ((shepherd-message-port (%make-void-port "w0")))
    …)

HTH,
Ludo’.





reply via email to

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