Skip to content

Commit

Permalink
little fix to avoid multiple instances of mapcrafter
Browse files Browse the repository at this point in the history
minor fixes to avoid initial logging problem
  • Loading branch information
muebau committed Aug 6, 2018
1 parent 2ba5bae commit ae7128d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:17.04
FROM ubuntu:18.04
MAINTAINER muebau <hb1c@gmx.net>

ENV DEBIAN_FRONTEND noninteractive
Expand All @@ -24,6 +24,7 @@ RUN apt-get update && \
ADD crontab /etc/cron.d/mapcrafter-cron
RUN chmod 0644 /etc/cron.d/mapcrafter-cron
RUN touch /var/log/cron.log
RUN echo "container created" >> /var/log/cron.log

ADD render.sh /render
RUN chmod 0777 /render
Expand Down
7 changes: 6 additions & 1 deletion render.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ if [ ! -f /config/render.conf ]; then
cp /render.conf /config/render.conf
fi

mapcrafter -c /config/render.conf -j 2 >> /var/log/cron.log 2>&1
RUNNINGMAPCRAFTERS=$(pgrep -c mapcrafter)
if [ $RUNNINGMAPCRAFTERS == "0" ]; then
mapcrafter -c /config/render.conf -j 2 >> /var/log/cron.log 2>&1
else
echo "Found $RUNNINGMAPCRAFTERS instances of mapcrafter. So no new instance was started." >> /var/log/cron.log
fi

0 comments on commit ae7128d

Please sign in to comment.