[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Shepherd timers
From: |
Ludovic Courtès |
Subject: |
Re: Shepherd timers |
Date: |
Wed, 01 May 2024 23:58:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi!
Felix Lechner <felix.lechner@lease-up.com> skribis:
> While 'command' works and was in your initial example, I had trouble
> tracking down the documentation for it. Is it a record entry destined
> for 'shepherd-command'?
>From the “Timers” section of the manual in the ‘devel’ branch:
--8<---------------cut here---------------start------------->8---
-- Procedure: command LINE [#:user #f] [#:group #f]
[#:environment-variables (default-environment-variables)]
[#:directory (default-service-directory)] [#:resource-limits
'()]
Return a new command for LINE, a program name and argument list, to
be executed as USER and GROUP, with the given
ENVIRONMENT-VARIABLES, in DIRECTORY, and with the given
RESOURCE-LIMITS.
These arguments are the same as for ‘fork+exec-command’ and related
procedures (*note ‘fork+exec-command’: exec-command.).
--8<---------------cut here---------------end--------------->8---
> Spoiled by Guix's seamless Guile integration, I don't shell out much
> anymore. Will 'command' accept a thunk?
No, but ‘make-timer-constructor’ does:
--8<---------------cut here---------------start------------->8---
-- Procedure: make-timer-constructor EVENT ACTION
[#:wait-for-termination?]
Return a procedure for use as the ‘start’ method of a service. The
procedure will perform ACTION at every occurrence of ‘event’, a
calendar event as returned by ‘calendar-event’. ACTION may be
either a command (returned by ‘command’) or a thunk; in the latter
case, the thunk must be suspendable or it could block the whole
shepherd process.
--8<---------------cut here---------------end--------------->8---
Ludo’.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Shepherd timers,
Ludovic Courtès <=