Most of the improvements are from shellcheck but I also had issues with the kill in the sigterm handler not working, presumably due to trying to kill after the server crashes in my case. By changing this to better handle the situation where the pid cannot be found, we avoid waiting forever and the container can die and be restarted by docker/podman/whatever properly.
Most of the improvements are from shellcheck but I also had issues with the
kill
in the sigterm handler not working, presumably due to trying to kill after the server crashes in my case. By changing this to better handle the situation where the pid cannot be found, we avoidwait
ing forever and the container can die and be restarted by docker/podman/whatever properly.Hope this is helpful to others!