GNU bug report logs - #62163
Suppress logging shepherd evaluation in mcron.log

Previous Next

Package: guix;

Reported by: Bruno Victal <mirai <at> makinata.eu>

Date: Mon, 13 Mar 2023 16:00:02 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bruno Victal <mirai <at> makinata.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 62163 <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: bug#62163: Suppress logging shepherd evaluation in mcron.log
Date: Tue, 28 Mar 2023 17:32:14 +0100
Hi Ludo’,

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.
It looks like this:  (#$task is what will perform the actual checks)

--8<---------------cut here---------------start------------->8---
(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))))))
           (when running?
             (case (status:exit-val (system* #$task))
               ((0) #t)
               ((125)
                (format #t "Heartbeat worker error~%"))
               (else
                (format #t "Issuing restart for service '~a'~%" '#$service)
                (restart-service '#$service)))))

         (exit)))))
--8<---------------cut here---------------end--------------->8---


This message also shows up if you're using certbot-service-type,
so it's not specific to the snippet above.


Cheers,
Bruno




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

Previous Next


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