Skip to content

Commit

Permalink
Fixed crontab on Debian / armhf
Browse files Browse the repository at this point in the history
  • Loading branch information
blackandred committed Apr 1, 2019
1 parent 78a710f commit 2b8f65c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion armhf.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN [ "cross-build-start" ]
RUN apt-get update \
&& apt-get -y install python3 python3-pip bash perl curl wget grep sed docker.io \
sudo mariadb-client postgresql-client netcat ca-certificates \
git openssl make python3-setuptools supervisor \
git openssl make python3-setuptools supervisor cron \
&& apt-get clean
RUN [ "cross-build-end" ]

Expand Down
11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/bin/bash

# depending on operating system, create an entrypoint for cron
echo "#!/bin/bash" > /entrypoint.cron.sh

if which crond > /dev/null; then
echo "crond -d 2 -f" >> /entrypoint.cron.sh
else
echo "cron -f" >> /entrypoint.cron.sh
fi

chmod +x /entrypoint.cron.sh

# allow to pass custom arguments from docker run command
echo "#!/bin/bash" > /entrypoint.cmd.sh
echo "infracheck --server --server-port 8000 $@" >> /entrypoint.cmd.sh
Expand Down
2 changes: 1 addition & 1 deletion supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ user=root ; default user
childlogdir=/var/log ; where child log files will live

[program:cron]
command=crond -d 2 -f
command=/entrypoint.cron.sh
user=root
stdout_events_enabled=true
stderr_events_enabled=true
Expand Down

0 comments on commit 2b8f65c

Please sign in to comment.