19 lines
537 B
Promela
19 lines
537 B
Promela
; Sending <exec SOMECOMMAND RESTARTPOLICY> causes the command to be run.
|
|
;
|
|
?? <exec ?argv ?restartPolicy> [
|
|
let ?id = timestamp
|
|
let ?facet = facet
|
|
let ?d = <temporary-exec $id $argv>
|
|
<run-service <daemon $d>>
|
|
<daemon $d {
|
|
argv: $argv,
|
|
readyOnStart: #f,
|
|
restart: $restartPolicy,
|
|
}>
|
|
? <service-state <daemon $d> complete> [$facet ! stop]
|
|
? <service-state <daemon $d> failed> [$facet ! stop]
|
|
]
|
|
|
|
; If the restart policy is not specified, it is defaulted to `on-error`.
|
|
;
|
|
?? <exec ?argv> ! <exec $argv on-error>
|