all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tomas Volf <~@wolfsden.cz>
To: Jake <jforst.mailman@gmail.com>
Cc: help-guix@gnu.org
Subject: Re: How to add the timer-trigger-action to a shepherd service?
Date: Wed, 18 Dec 2024 15:06:15 +0100	[thread overview]
Message-ID: <8734ilaxwo.fsf@wolfsden.cz> (raw)
In-Reply-To: <CAJqVjv8KK4kb7cRQxpEt68jrN1Us9T-M2YNdn9KhMSGPhvV0EQ@mail.gmail.com> (Jake's message of "Mon, 16 Dec 2024 23:43:27 +0000")

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

Jake <jforst.mailman@gmail.com> writes:

> Hi Tomas
>
> I got the snippet below from the patch series
> https://issues.guix.gnu.org/74860
>
>    (actions (list (shepherd-action
>                    (name 'trigger)
>                    (documentation "Trigger something.")
>                    (procedure #~trigger-timer))))

Oh, this seems a bit more elegant that the version with identity, thanks
for the suggestion.

>
> Cheers
> Jake
>
>
>
> On Mon, Dec 16, 2024 at 10:54 PM Tomas Volf <~@wolfsden.cz> wrote:
>
>>
>> Hello,
>>
>> I am trying to use the new shepherd timers in my guix configuration.  I
>> got it working with some help on IRC, except I cannot figure out how to
>> configure the extra action.  Shepherd's manual gives this example:
>>
>> --8<---------------cut here---------------start------------->8---
>>      (define updatedb
>>        (service
>>          '(updatedb)
>>          #:start (make-timer-constructor
>>                    ;; Fire at midnight and noon everyday.
>>                    (calendar-event #:hours '(0 12) #:minutes (0))
>>                    (command '("/usr/bin/updatedb"
>>                               "--prunepaths=/tmp")))
>>          #:stop (make-timer-destructor)
>>          #:actions (list timer-trigger-action)))
>> --8<---------------cut here---------------end--------------->8---
>>
>> However I cannot figure out what to put into the (actions) field of the
>> shepherd-service record.  Documentation says it should be instance of
>> shepherd-action, however I have no idea how to turn the
>> timer-trigger-action into it.  Any suggestions?
>>
>> Thanks,
>> Tomas
>>
>> --
>> There are only two hard things in Computer Science:
>> cache invalidation, naming things and off-by-one errors.
>>

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

      reply	other threads:[~2024-12-18 14:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 22:53 How to add the timer-trigger-action to a shepherd service? Tomas Volf
2024-12-16 23:36 ` Felix Lechner via
2024-12-18 14:05   ` Tomas Volf
2024-12-16 23:43 ` Jake
2024-12-18 14:06   ` Tomas Volf [this message]

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=8734ilaxwo.fsf@wolfsden.cz \
    --to=~@wolfsden.cz \
    --cc=help-guix@gnu.org \
    --cc=jforst.mailman@gmail.com \
    /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.