services: clash: Add shepherd-provision configuration.

* rosenthal/services/child-error.scm (clash-configuration): Add field
shepherd-provision.
(clash-shepherd-service): Use it.
pull/2/head
Hilton Chain 1 year ago
parent 1c50972d30
commit a3d7639ccd
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292
  1. 11
      rosenthal/services/child-error.scm

@ -50,15 +50,22 @@
(clash (clash
(file-like clash-bin) (file-like clash-bin)
"The clash package.") "The clash package.")
(log-file (log-file
(string "/var/log/clash.log") (string "/var/log/clash.log")
"Where the logs go.") "Where the logs go.")
(data-directory (data-directory
(string "/var/lib/clash") (string "/var/lib/clash")
"Where to store data.") "Where to store data.")
(config (config
(file-like (plain-file "empty" "")) (file-like (plain-file "empty" ""))
"Clash configuration file.") "Clash configuration file.")
(shepherd-provision
(list '(clash))
"A list of Shepherd service names (symbols) provided by this service.")
(no-serialization)) (no-serialization))
(define %clash-accounts (define %clash-accounts
@ -85,10 +92,10 @@
(define clash-shepherd-service (define clash-shepherd-service
(match-record-lambda <clash-configuration> (match-record-lambda <clash-configuration>
(clash log-file data-directory config) (clash log-file data-directory config shepherd-provision)
(list (shepherd-service (list (shepherd-service
(documentation "Run clash.") (documentation "Run clash.")
(provision '(clash)) (provision shepherd-provision)
(requirement '(loopback networking)) (requirement '(loopback networking))
(start #~(make-forkexec-constructor (start #~(make-forkexec-constructor
(list (let ((clash-meta-cmd (list (let ((clash-meta-cmd

Loading…
Cancel
Save