2021-09-19 14:53:37 +00:00
|
|
|
version 1 .
|
|
|
|
embeddedType EntityRef.Cap .
|
|
|
|
|
|
|
|
Service = DaemonService .
|
|
|
|
|
|
|
|
DaemonService = <daemon @id DaemonId> .
|
|
|
|
|
|
|
|
DaemonProcess = <daemon @id DaemonId @config DaemonSpec>.
|
|
|
|
DaemonId = any .
|
2021-09-20 14:42:35 +00:00
|
|
|
DaemonSpec = @simple CommandLine / @full FullDaemonSpec .
|
2021-09-28 10:53:11 +00:00
|
|
|
FullDaemonSpec =
|
|
|
|
& { argv: CommandLine }
|
|
|
|
& @env DaemonEnv
|
|
|
|
& @dir DaemonDir
|
|
|
|
& @clearEnv ClearEnv
|
|
|
|
& @readyOnStart ReadyOnStart
|
|
|
|
& @restart RestartField
|
|
|
|
.
|
2021-09-20 14:42:35 +00:00
|
|
|
DaemonEnv = @present { env: { EnvVariable: EnvValue ...:... } } / @invalid { env: any } / @absent {} .
|
|
|
|
DaemonDir = @present { dir: string } / @invalid { dir: any } / @absent {} .
|
|
|
|
ClearEnv = @present { clearEnv: bool } / @invalid { clearEnv: any } / @absent {} .
|
2021-09-28 10:53:11 +00:00
|
|
|
ReadyOnStart = @present { readyOnStart: bool } / @invalid { readyOnStart: any } / @absent {} .
|
|
|
|
RestartField = @present { restart: RestartPolicy } / @invalid { restart: any } / @absent {} .
|
2021-09-19 14:53:37 +00:00
|
|
|
|
2021-09-20 14:42:35 +00:00
|
|
|
CommandLine = @shell string / @full FullCommandLine .
|
|
|
|
FullCommandLine = [@program string, @args string ...] .
|
|
|
|
|
|
|
|
EnvVariable = @string string / @symbol symbol / @invalid any .
|
|
|
|
EnvValue = @set string / @remove #f / @invalid any .
|
2021-09-28 10:53:11 +00:00
|
|
|
|
|
|
|
RestartPolicy =
|
|
|
|
/ ; Whether the process terminates normally or abnormally, restart it
|
|
|
|
; without affecting any peer processes within the service.
|
|
|
|
=always
|
|
|
|
/ ; If the process terminates normally, leave everything alone; if it
|
|
|
|
; terminates abnormally, restart it without affecting peers.
|
|
|
|
@onError =on-error
|
|
|
|
/ ; If the process terminates normally, leave everything alone; if it
|
|
|
|
; terminates abnormally, restart the whole daemon (all processes
|
|
|
|
; within the daemon).
|
|
|
|
=all
|
|
|
|
.
|