mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
services: mcron: Validate jobs even in the presence of #:user.
Fixes a bug in 949672c923
whereby jobs
specifying a #:user not available in the build environment would fail
validation.
Reported by Maxim Cournoyer.
* gnu/services/mcron.scm (job-files)[validated-file]: Add "prologue"
file and pass it to 'mcron --schedule'.
This commit is contained in:
parent
ce022b2e14
commit
ef5ddb0e17
1 changed files with 10 additions and 1 deletions
|
@ -67,12 +67,21 @@ (define (validated-file job)
|
|||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
|
||||
(call-with-output-file "prologue"
|
||||
(lambda (port)
|
||||
;; This prologue allows 'mcron --schedule' to
|
||||
;; proceed no matter what #:user option is passed
|
||||
;; to 'job'.
|
||||
(write '(set! getpw
|
||||
(const (getpwuid (getuid))))
|
||||
port)))
|
||||
|
||||
(call-with-output-file "job"
|
||||
(lambda (port)
|
||||
(write '#$job port)))
|
||||
|
||||
(invoke #+(file-append mcron "/bin/mcron")
|
||||
"--schedule=20" "job")
|
||||
"--schedule=20" "prologue" "job")
|
||||
(copy-file "job" #$output)))
|
||||
#:options '(#:env-vars (("COLUMNS" . "150")))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue