From 4e32ff4f1fff67c1f28f4d6f73be9f2507cbfc01 Mon Sep 17 00:00:00 2001 From: Berger Eugene Date: Sat, 9 Jul 2022 21:54:57 +0300 Subject: [PATCH] Daemon readme content updates --- README.md | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d27f4b5..238b779 100755 --- a/README.md +++ b/README.md @@ -158,23 +158,41 @@ process2: ##### ✅ Termination Parameters ```yaml -process1: - command: "pg_ctl start" +nginx: + command: "docker run --rm --name nginx_test nginx" shutdown: - command: "pg_ctl stop" + command: "docker stop nginx_test" timeout_seconds: 10 # default 10 - signal: 15 # default 15, but only if command is not defined or empty + signal: 15 # default 15, but only if the 'command' is not defined or empty ``` -`shutdown` is optional and can be omitted. The default behaviour in this case: `SIGTERM` is issued to the running process. +`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 the `shutdown.command` is defined: +In case the `shutdown.command` is defined: + +1. The `shutdown.command` is executed with all the Environment Variables of the primary process +2. Wait for `shutdown.timeout_seconds` for its completion (if not defined wait for 10 seconds) +3. In case of timeout, the process will receive the `SIGKILL` signal + +##### ✅ Background (detached) Processes + +```yaml +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 +``` + +1. For processes that start services / daemons in the background, please use the `is_daemon` flag set to `true`. -1. The `shutdown.command` is executed with all the Environment Variables of the main process -2. Wait `shutdown.timeout_seconds` for its completion (if not defined wait for 10 seconds) -3. In case of timeout the process will receive the `SIGKILL` signal +2. In case a process is daemon it will be considered running until stopped. + +3. Daemon processes can only be stopped with the `$PROCESSNAME.shutdown.command` as in the example above. #### ✅ Output Handling @@ -279,8 +297,6 @@ Probes configuration and functionality are designed to work similarly to [Kubern failure_threshold: 3 ``` - - ##### ✅ Readiness Probe ```yaml