Previously when running the Valhalla service with e.g.:
$ docker run -v $PWD/data:/data ghcr.io/gis-ops/docker-valhalla/valhalla
...
INFO: Found config file. Starting valhalla service!
....
You couldn't stop it with Ctrl+C (SIGINT) or kill $! (SIGTERM) when run in the background, because the run.sh shell script didn't use exec for the valhalla_service command, which resulted in an intermediary shell process (that didn't pass the signals to child processes because Docker gives it PID 1, which is special1). This is a well-known pitfall of Docker ENTRYPOINT shell scripts.2
This commit fixes that oversight.
Sidenote: It still takes ~30 seconds for a SIGTERM to shutdown the server because valhalla_service has configured such a graceful shutdown period for the prime_server HTTP server.
Previously when running the Valhalla service with e.g.:
You couldn't stop it with Ctrl+C (SIGINT) or
kill $!
(SIGTERM) when run in the background, because the run.sh shell script didn't useexec
for thevalhalla_service
command, which resulted in an intermediary shell process (that didn't pass the signals to child processes because Docker gives it PID 1, which is special1). This is a well-known pitfall of Docker ENTRYPOINT shell scripts.2This commit fixes that oversight.
Sidenote: It still takes ~30 seconds for a SIGTERM to shutdown the server because valhalla_service has configured such a graceful shutdown period for the prime_server HTTP server.