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'.
master
parent
ce022b2e14
commit
ef5ddb0e17
|
@ -67,12 +67,21 @@
|
|||
#~(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")))))
|
||||
|
||||
|
|
Reference in New Issue