-
-
Notifications
You must be signed in to change notification settings - Fork 53
Process Launcher
Berger Eugene edited this page Jul 16, 2022
·
2 revisions
process1:
command: "sleep 3"
process2:
command: "sleep 3"
process1:
command: "sleep 3"
depends_on:
process2:
condition: process_completed_successfully # or "process_completed" if you don't care about errors
process2:
command: "sleep 3"
depends_on:
process3:
condition: process_completed_successfully # or "process_completed" if you don't care about errors
process2:
depends_on:
process3:
condition: process_completed_successfully # or "process_started" (default)
process3:
condition: process_completed_successfully
nginx:
command: "docker run --rm --name nginx_test nginx"
shutdown:
command: "docker stop nginx_test"
timeout_seconds: 10 # default 10
signal: 15 # default 15, but only if the 'command' is not defined or empty
shutdown
is optional and can be omitted. The default behavior in this case: SIGTERM
is issued to the running process.
In case only shutdown.signal
is defined [1..31]
the running process will be terminated with its value.
In case the shutdown.command
is defined:
- The
shutdown.command
is executed with all the Environment Variables of the primary process - Wait for
shutdown.timeout_seconds
for its completion (if not defined wait for 10 seconds) - In case of timeout, the process will receive the
SIGKILL
signal
nginx:
command: "docker run -d --rm --name nginx_test nginx" # note the '-d' for detached mode
is_daemon: true # this flag is required for background processes (default false)
shutdown:
command: "docker stop nginx_test"
timeout_seconds: 10 # default 10
signal: 15 # default 15, but only if command is not defined or empty
-
For processes that start services / daemons in the background, please use the
is_daemon
flag set totrue
. -
In case a process is daemon it will be considered running until stopped.
-
Daemon processes can only be stopped with the
$PROCESSNAME.shutdown.command
as in the example above.