all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Felix Lechner <felix.lechner@lease-up.com>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Shepherd timers
Date: Thu, 28 Mar 2024 23:32:07 +0100	[thread overview]
Message-ID: <87o7ayj8d4.fsf@gnu.org> (raw)
In-Reply-To: <877chq3p48.fsf@lease-up.com> (Felix Lechner's message of "Mon, 25 Mar 2024 15:47:51 -0700")

Hello!

Felix Lechner <felix.lechner@lease-up.com> skribis:

> The simple example worked great, but my more complex attempt to convert
> an mcron job seems to have failed.  Do you know why?
>
> (define (rsync-debbugs-shepherd-service config)
>   (shepherd-service
>    (provision '(rsync-debbugs))

Nice use case.  :-)

>> herd restart rsync-debbugs
> Service user-homes has been started.
> Starting service rsync-debbugs...
> Service rsync-debbugs started.
> Service rsync-debbugs running with value #<<timer> channel: #<<channel> getq: #<atomic-box 7fb467c1c990 value: (())> getq-gc-counter: #<atomic-box 7fb467c1c980 value: 42> putq: #<atomic-box 7fb467c1c960 value: (())> putq-gc-counter: #<atomic-box 7fb467c1c950 value: 42>> event: #<<calendar-event> seconds: (0) minutes: (iota 12 3 5) hours: (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23) days-of-month: (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31) months: (1 2 3 4 5 6 7 8 9 10 11 12) days-of-week: #f> action: #<<command> arguments: ("/gnu/store/1g0gk9pcymgc0bb1dh115swakmh438p6-rsync-3.2.7/bin/rsync" "-4" "--delete" "-av" "--password-file=/root/secrets/var-lib-debbugs.rsync" "debbugs-var@debbugs.gnu.org::var-lib-debbugs" "/var/lib/debbugs/") user: #f group: #f environment-variables: ("HOME=/" "TERM=linux" "BOOT_IMAGE=/gnu/store/psn2jwyrvr8jxb1nrndxf3h7kg8vvfwa-linux-6.6.2/bzImage" "PATH=/gnu/store/2jbvnib5ar70q1vlhhngish1svqfry0j-e2fsck-static-1.46.4/sbin:/gnu/store/jlbzcgxxzhynv74ss2510b0x978srnf9-loadkeys-static-2.5.1/bin" "GUIX_LOCPATH=/gnu/store/5fmqijrs5f7vx8mc2q2pmq26yvhb74sm-glibc-utf8-locales-2.35/lib/locale") directory: "/" resource-limits: ()>>.
> Service rsync-debbugs has been started.
> #[STATUS] End time 2024-03-25 14:04:40, duration 1.081s
> (root@wallace-server.local)[/s/srv/patchwise]
>> herd status rsync-debbugs
> #[STATUS] End time 2024-03-25 14:07:41, duration 159.524s

So ‘herd status rsync-debbugs’ exited after 160s without printing
anything?  What does /var/log/messages say?

I tried something similar on my laptop but it seems to work.

Namely, I have:

--8<---------------cut here---------------start------------->8---
(use-modules (shepherd service timer))

(define gc-timer
  (service
   '(gc)
   #:start (make-timer-constructor
            (calendar-event #:minutes '(0))
            (command '("/run/current-system/profile/bin/guix" "gc" "-F2G")
                     #:user "ludo"))
   #:stop (make-timer-destructor)
   #:actions (list timer-trigger-action)))

(register-services (list gc-timer))
--8<---------------cut here---------------end--------------->8---

And then I do:

  sudo herd load root that-file.scm

I start, restart, reload, restart, etc. and it seems fine.

Thanks for trying it out!

Ludo’.


  reply	other threads:[~2024-03-28 22:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-24 21:20 Shepherd timers Ludovic Courtès
2024-03-25  9:14 ` raingloom
2024-03-28 22:22   ` Ludovic Courtès
2024-03-25 22:47 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-03-28 22:32   ` Ludovic Courtès [this message]
2024-04-02 14:23     ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-04-10 14:45       ` Ludovic Courtès
2024-04-14 19:47         ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-04-19 14:35           ` Ludovic Courtès
2024-04-21 21:28             ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-05-01 21:58               ` Ludovic Courtès
2024-04-03  1:08 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-04-10 14:44   ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2024-03-31  3:15 Adam Faiz
2024-03-31  4:07 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-03-31  4:09 ` 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=87o7ayj8d4.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=felix.lechner@lease-up.com \
    --cc=guix-devel@gnu.org \
    /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.