-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cron doesn't load environment variables. #383
Comments
I was able to reproduce this. # import
docker run --rm -e UPDATES=enabled -e THREADS=2 -v osm-data:/data/database/ overv/openstreetmap-tile-server import
# run in background
docker run -d --name osm --rm -e UPDATES=enabled -e THREADS=2 -v osm-data:/data/database/ overv/openstreetmap-tile-server run
# change the update script to write the THREADS env to a debug file instead
docker exec osm bash -c "echo 'echo \${THREADS:-default} >/tmp/debugenv' >/usr/bin/openstreetmap-tiles-update-expire.sh"
# wait a minute for crontab to execute the script
# output the contents of the debug file
docker exec osm bash -c "cat /tmp/debugenv" This outputs Workaround that results in docker exec osm bash -c "printenv >/etc/environment"
openstreetmap-tile-server/run.sh Lines 174 to 175 in 6088b9b
|
Istador
added a commit
to Istador/openstreetmap-tile-server
that referenced
this issue
Aug 9, 2023
This commit fixes Overv#383
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I define some environment variables in
docker-compose.yml
(e.g.THREADS=8
) which get used correctly for setting uprenderd.conf
openstreetmap-tile-server/run.sh
Line 171 in 6088b9b
But the
openstreetmap-tiles-update-expire.sh
executed via Cron doesn't have access to the enviroment variables.This results in execution of
openstreetmap-tiles-update-expire.sh
with default parameters.The text was updated successfully, but these errors were encountered: