Skip to content

initial add for instrumentation #12

Merged
merged 1 commit into from Feb 3, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile
Expand Up @@ -44,6 +44,14 @@ ADD container_files/bin/onbuild.sh /opt/autoexec/bin/onbuild.sh
ADD container_files/bin/stub.sh /opt/autoexec/firstrun/stub.sh
ADD container_files/bin/stub.sh /opt/autoexec/onbuild/stub.sh

ADD container_files/tier-crontab /opt/tier/tier-crontab
RUN crontab /opt/tier/tier-crontab
ADD container_files/bin/startcron.sh /usr/bin/startcron.sh
RUN chmod +x /usr/bin/startcron.sh
ADD container_files/bin/sendtierbeacon.sh /usr/bin/sendtierbeacon.sh
RUN touch /var/log/cron.log


# Set default environment variables.
ENV HOME /opt/tier

Expand All @@ -52,3 +60,6 @@ RUN touch /tmp/firsttimerunning

# Define working directory.
WORKDIR /opt/tier


CMD /usr/bin/startcron.sh
7 changes: 7 additions & 0 deletions container_files/bin/sendtierbeacon.sh
@@ -0,0 +1,7 @@
#!/bin/sh
LOGHOST="cerif.org"
LOGPORT="5000"
LOGTEXT="TIERBEACON/TIER/1.0#IM=$IMAGENAME#IV=$VERSION#MT=$MAINTAINER#"
if [ -z "$TIER_BEACON_OPT_OUT" ]; then
`logger -n $LOGHOST -P $LOGPORT -t TIERBEACON $LOGTEXT`
fi
3 changes: 3 additions & 0 deletions container_files/bin/startcron.sh
@@ -0,0 +1,3 @@
#!/bin/sh
cron
touch /var/log/cron.log
2 changes: 2 additions & 0 deletions container_files/tier-crontab
@@ -0,0 +1,2 @@
#send daily ping to TIER Central
0 0 * * * /usr/bin/sendtierbeacon.sh >> /var/log/cron.log 2>&1