help-guix
[Top][All Lists]
Advanced

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

Re: How to add the timer-trigger-action to a shepherd service?


From: Tomas Volf
Subject: Re: How to add the timer-trigger-action to a shepherd service?
Date: Wed, 18 Dec 2024 15:06:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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: signature.asc
Description: PGP signature


reply via email to

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