Hi!

Felix Lechner <felix.lech...@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’.

Reply via email to