@@ -19379,6 +19379,10 @@ Scheduled Job Execution
@item @code{mcron} (default: @code{mcron}) (type: file-like)
The mcron package to use.
+@item @code{shepherd-requirement} (default: @code{()}) (type: list-of-symbols)
+This is a list of symbols naming Shepherd services that this service
+will depend on.
+
@item @code{jobs} (default: @code{()}) (type: list-of-gexps)
This is a list of gexps (@pxref{G-Expressions}), where each gexp
corresponds to an mcron job specification (@pxref{Syntax, mcron job
@@ -32,6 +32,7 @@ (define-module (gnu services mcron)
#:export (mcron-configuration
mcron-configuration?
mcron-configuration-mcron
+ mcron-configuration-shepherd-requirement
mcron-configuration-jobs
mcron-configuration-log?
mcron-configuration-log-file
@@ -58,6 +59,9 @@ (define-module (gnu services mcron)
(define list-of-gexps?
(list-of gexp?))
+(define list-of-symbols?
+ (list-of symbol?))
+
(define-maybe/no-serialization string)
(define-configuration/no-serialization mcron-configuration
@@ -65,6 +69,11 @@ (define-configuration/no-serialization mcron-configuration
(file-like mcron)
"The mcron package to use.")
+ (shepherd-requirement
+ (list-of-symbols '())
+ "This is a list of symbols naming Shepherd services that this service
+will depend on.")
+
(jobs
(list-of-gexps '())
"This is a list of gexps (@pxref{G-Expressions}), where each gexp
@@ -158,13 +167,13 @@ (define (shepherd-schedule-action mcron files)
(define (mcron-shepherd-services config)
(match-record config <mcron-configuration>
- (mcron jobs log? log-file log-format date-format)
+ (mcron shepherd-requirement jobs log? log-file log-format date-format)
(if (eq? jobs '())
'() ;nothing to do
(let ((files (job-files mcron jobs)))
(list (shepherd-service
(provision '(mcron))
- (requirement '(user-processes))
+ (requirement `(user-processes ,@shepherd-requirement))
(modules `((srfi srfi-1)
(srfi srfi-26)
(ice-9 popen) ;for the 'schedule' action