Skip to content

fixes for starting crond in containers #29

Merged
merged 1 commit into from
Feb 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@ RUN set -x \
ADD files/idp.xml conf/Catalina/idp.xml
ADD files/server.xml conf/server.xml

ADD files/bin/setenv.sh /opt/tier/setenv.sh
RUN chmod +x /opt/tier/setenv.sh
ADD files/tier-crontab /opt/tier/tier-crontab
RUN crontab /opt/tier/tier-crontab
ADD files/bin/startcron.sh /usr/bin/startcron.sh
RUN chmod +x /usr/bin/startcron.sh
ADD files/tier-crontab /etc/cron.d/tier-crontab
ADD files/bin/startup.sh /usr/bin/startup.sh
RUN chmod +x /usr/bin/startup.sh
ADD files/bin/sendtierbeacon.sh /usr/bin/sendtierbeacon.sh
RUN chmod +x /usr/bin/sendtierbeacon.sh
RUN touch /var/log/cron.log
Expand All @@ -106,4 +109,3 @@ ENV PATH $CATALINA_HOME/bin:$JAVA_HOME/bin:$PATH

ONBUILD COPY ./root/ /opt/shibboleth/$SHIB_PREFIX/

CMD /usr/bin/startcron.sh
3 changes: 3 additions & 0 deletions files/bin/sendtierbeacon.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh
LOGHOST="cerif.org"
LOGPORT="5000"
if [ -s /opt/tier/env.bash ]; then
. /opt/tier/env.bash
fi
LOGTEXT="TIERBEACON/TIER/1.0#IM=$IMAGENAME#IV=$VERSION-$TIERVERSION#MT=$MAINTAINER#"
if [ -z "$TIER_BEACON_OPT_OUT" ]; then
`logger -n $LOGHOST -P $LOGPORT -t TIERBEACON $LOGTEXT`
Expand Down
4 changes: 4 additions & 0 deletions files/bin/setenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^VERSION" > /opt/tier/env.bash
printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^TIERVERSION" >> /opt/tier/env.bash
printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^IMAGE" >> /opt/tier/env.bash
printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^MAINTAINER" >> /opt/tier/env.bash
3 changes: 0 additions & 3 deletions files/bin/startcron.sh

This file was deleted.

5 changes: 5 additions & 0 deletions files/bin/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
/opt/tier/setenv.sh
touch /var/log/cron.log
/usr/sbin/crond
/usr/local/tomcat/bin/catalina.sh run