When a program is running as PID 1, its default SIGTERM and SIGINT handlers ignore the signal completely, instead of exiting.
As the program is running as PID 1 in the container, and does not set its own handlers for these signals, it ignores them, which makes it unnecessarily take longer to stop the container, as podman/docker waits some time after sending SIGTERM before resorting to SIGKILL.
The program should set its own handlers for SIGTERM and SIGINT, which do the necessary cleanup (if necessary) and exit.
When a program is running as PID 1, its default SIGTERM and SIGINT handlers ignore the signal completely, instead of exiting. As the program is running as PID 1 in the container, and does not set its own handlers for these signals, it ignores them, which makes it unnecessarily take longer to stop the container, as podman/docker waits some time after sending SIGTERM before resorting to SIGKILL.
The program should set its own handlers for SIGTERM and SIGINT, which do the necessary cleanup (if necessary) and exit.