Add proper handling of docker stop

This commit is contained in:
Alexander Overvoorde 2019-10-12 12:35:16 +02:00
parent ca4b1acb04
commit 6e5f4f485d
2 changed files with 12 additions and 2 deletions

View File

@ -63,6 +63,8 @@ docker run \
run
```
**If you do this, then make sure to also run the import with the `openstreetmap-rendered-tiles` volume to make sure that caching works properly across updates!**
### Enabling automatic updating (optional)
Given that you've specified both the OSM data and polygon as specified in the *Automatic updates* section during server setup, you can enable the updating process by setting the variable `UPDATES` to `enabled`:

12
run.sh
View File

@ -95,8 +95,16 @@ if [ "$1" = "run" ]; then
/etc/init.d/cron start
fi
# Run
sudo -u renderer renderd -f -c /usr/local/etc/renderd.conf
# Run while handling docker stop's SIGTERM
stop_handler() {
kill -TERM "$child"
}
trap stop_handler SIGTERM
sudo -u renderer renderd -f -c /usr/local/etc/renderd.conf &
child=$!
wait "$child"
service postgresql stop
exit 0