syndicate-rs/syndicate-server/protocols/schemas/externalServices.prs

43 lines
1.5 KiB
Plaintext
Raw Normal View History

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 .
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 {} .
ReadyOnStart = @present { readyOnStart: bool } / @invalid { readyOnStart: any } / @absent {} .
RestartField = @present { restart: RestartPolicy } / @invalid { restart: any } / @absent {} .
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 .
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
.