We have Docker container which is running systemd as main process (PID 1). We have also started our worker processes in Docker container through systemd unit. Our Docker containers uses CentOS 7.2. We have configured the Docker stop timeout so that we can handle the graceful shutdown of worker processes running inside Docker container. When we are stopping Docker container, we can see SIGTERM is received to systemd process which is running with PID 1 inside container. Also container waits for stop timeout which we have configured. But systemd process is not forwarding this SIGTERM to our worker processes which we have started using systemd unit. From logs it looks like when systemd receives SIGTERM it tries to re-executes itself. We have tried with adding KillMode=mixed in our systemd unit file but it didn’t worked for us.
Is there any way to forward SIGTERM from systemd process to the child processes ?