mirror of
git://git.savannah.gnu.org/guix.git
synced 2023-12-14 03:33:07 +01: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 @@
|
|||
#~(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