Fix issues with creating orphan processes

By using bash (which plays nicely by reparenting orphan processes)
This commit is contained in:
2019-12-16 04:11:58 +00:00
parent fd879c12e2
commit 9afb7e685f
2 changed files with 8 additions and 4 deletions

View File

@@ -1,13 +1,14 @@
FROM registry.lan/alpine:3.10 FROM registry.lan/alpine:3.10
RUN apk -v --update add \ RUN apk -v --update add \
bash \
python \ python \
py-pip \ py-pip \
groff \ groff \
less \ less \
mailcap \ mailcap \
jq \ jq \
wget \
&& \ && \
pip install --upgrade awscli==1.14.5 s3cmd==2.0.1 python-magic && \ pip install --upgrade awscli==1.14.5 s3cmd==2.0.1 python-magic && \
apk -v --purge del py-pip && \ apk -v --purge del py-pip && \
@@ -17,7 +18,8 @@ COPY ./update-dns.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/update-dns.sh RUN chmod +x /usr/local/bin/update-dns.sh
RUN mkdir -p /etc/cron.d/ RUN mkdir -p /etc/cron.d/
RUN echo -e "*/10 * * * * update-dns.sh\n" > /etc/cron.d/dns-cron RUN echo -e "*/10 * * * * /bin/bash update-dns.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/dns-cron
RUN crontab /etc/cron.d/dns-cron RUN crontab /etc/cron.d/dns-cron
RUN touch /var/log/cron.log
CMD ["crond", "-f"] CMD crond && tail -f /var/log/cron.log

View File

@@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
set -eux set -eux
@@ -28,3 +28,5 @@ EOM
) )
aws route53 change-resource-record-sets --hosted-zone-id "${zone_id}" --change-batch "$batch" aws route53 change-resource-record-sets --hosted-zone-id "${zone_id}" --change-batch "$batch"
wait