Hello,
I think about if it is a good idea to nohup
my script inside a Kubernetes Pod / Docker Container.
The use case is a bash-script which sends an alert via curl and pushover. After that, it is waiting for an acknowledgement from the user for that alert. (Pushover: Receipts API)
If there is no acknowledgement, another alert (to a different user) is sent.
If the container was stopped while waiting for the acknowledgement (sleep and curl in a loop), the process for that alert would be interrupted. So I think about to release that process from the containers lifetime.
Actually, the alert triggered by kapacitor with the exec
-handler is not a child-process of the one with pid1, so it is not even possible to handle signals within the script …
root 1 4.9 0.1 2706372 161568 ? Ssl 17:43 0:44 kapacitord
root 19575 0.0 0.0 17976 2824 ? S 17:58 0:00 /bin/bash /usr/local/bin/pushover-alert-chain.sh
root 19576 0.0 0.0 4184 612 ? S 17:58 0:00 \_ sleep 30