Permalink
Browse files
Integrate latest changes to midPoint container
These changes are: Zulu JVM, logging fixes, TIER Beacon. The crond is now running in foreground to avoid "can't lock /var/run/crond.pid" messages.
- Loading branch information
Showing
with
161 additions
and 23 deletions.
- +1 −0 midpoint/.env
- +35 −7 midpoint/midpoint-server/Dockerfile
- +7 −0 midpoint/midpoint-server/container_files/opt-tier/setenv.sh
- +2 −2 midpoint/midpoint-server/container_files/shibboleth/native.logger
- +3 −3 midpoint/midpoint-server/container_files/shibboleth/shibd.logger
- +25 −0 midpoint/midpoint-server/container_files/supervisor/supervisord.conf
- +37 −0 midpoint/midpoint-server/container_files/usr-local-bin/send-tier-beacon.sh
- +14 −0 midpoint/midpoint-server/container_files/usr-local-bin/setup-cron.sh
- +28 −0 midpoint/midpoint-server/container_files/usr-local-bin/start-all.sh
- +8 −0 midpoint/midpoint-server/container_files/usr-local-bin/start-httpd-shib.sh
- +1 −11 midpoint/midpoint-server/container_files/usr-local-bin/{entrypoint.sh → start-midpoint.sh}
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^MP_VERSION" > /opt/tier/env.bash | ||
printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^TIER_RELEASE" >> /opt/tier/env.bash | ||
printenv | sed 's/^\(.*\)$/\1/g' | grep -E "^TIER_MAINTAINER" >> /opt/tier/env.bash | ||
|
||
echo "/opt/tier/env.bash is:" | ||
cat /opt/tier/env.bash |
@@ -0,0 +1,25 @@ | ||
[supervisord] | ||
logfile=/tmp/logsuperd | ||
logfile_maxbytes=0 | ||
loglevel=error | ||
nodaemon=true | ||
user=root | ||
|
||
[program:httpd-shib] | ||
command=/bin/bash -c "/usr/local/bin/start-httpd-shib.sh" | ||
stdout_logfile=/tmp/loghttpd | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
|
||
[program:midpoint] | ||
command=/bin/bash -c "/usr/local/bin/start-midpoint.sh" | ||
stdout_logfile=/dev/fd/2 | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
|
||
[program:tier-beacon] | ||
command=/usr/sbin/crond -n -i -m off | ||
stdout_logfile=/tmp/logcrond | ||
stdout_logfile_maxbytes=0 | ||
redirect_stderr=true | ||
autorestart=false |
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
LOGHOST="localhost" | ||
LOGPORT="80" | ||
|
||
if [ -s /opt/tier/env.bash ]; then | ||
. /opt/tier/env.bash | ||
fi | ||
|
||
messagefile="/tmp/beaconmsg" | ||
|
||
if [ -z "$TIER_BEACON_OPT_OUT" ]; then | ||
cat > $messagefile <<EOF | ||
{ | ||
"msgType" : "TIERBEACON", | ||
"msgName" : "TIER", | ||
"msgVersion" : "1.0", | ||
"tbProduct" : "MIDPOINT", | ||
"tbProductVersion" : "$MP_VERSION", | ||
"tbTIERRelease" : "$TIER_RELEASE", | ||
"tbMaintainer" : "$TIER_MAINTAINER" | ||
} | ||
EOF | ||
|
||
# echo `date`": going to send TIER beacon to ${LOGHOST}:${LOGPORT}:" | ||
# cat $messagefile | ||
|
||
curl -s -XPOST "${LOGHOST}:${LOGPORT}/" -H 'Content-Type: application/json' -T $messagefile 1>/dev/null 2>&1 | ||
if [ $? -eq 0 ]; then | ||
echo `date`": TIER beacon sent" | ||
else | ||
echo `date`": Failed to send TIER beacon" | ||
fi | ||
|
||
rm -f $messagefile 1>/dev/null 2>&1 | ||
|
||
fi |
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
CRONFILE=/opt/tier/cronfile | ||
|
||
if [ "$TIER_BEACON_ENABLED" == "true" ]; then | ||
echo "#send daily \"beacon\" to central" > ${CRONFILE} | ||
# echo $(expr $RANDOM % 59) $(expr $RANDOM % 3) "* * * /usr/local/bin/send-tier-beacon.sh >> /tmp/logcrond 2>&1" >> ${CRONFILE} | ||
echo "* * * * * /usr/local/bin/send-tier-beacon.sh >> /tmp/logcrond 2>&1" >> ${CRONFILE} # for testing | ||
else | ||
echo "#beacon is disabled" > ${CRONFILE} | ||
fi | ||
|
||
chmod 644 ${CRONFILE} | ||
crontab ${CRONFILE} |
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# normalizing logging variables as required by TIER | ||
export ENV=${ENV//[; ]/_} | ||
export USERTOKEN=${USERTOKEN//[; ]/_} | ||
|
||
/usr/local/bin/setup-cron.sh | ||
|
||
# generic console logging pipe for anyone | ||
mkfifo -m 666 /tmp/logpipe | ||
cat <> /tmp/logpipe 1>&2 & | ||
|
||
mkfifo -m 666 /tmp/loghttpd | ||
(cat <> /tmp/loghttpd | awk '{printf "%s\n", $0; fflush()}' 1>/tmp/logpipe) & | ||
|
||
mkfifo -m 666 /tmp/logshib | ||
(cat <> /tmp/logshib | awk '{printf "%s\n", $0; fflush()}' 1>/tmp/logpipe) & | ||
|
||
mkfifo -m 666 /tmp/logcrond | ||
(cat <> /tmp/logcrond | awk -v ENV="$ENV" -v USERTOKEN="$USERTOKEN" '{printf "crond;console;%s;%s;%s\n", ENV, USERTOKEN, $0; fflush()}' 1>/tmp/logpipe) & | ||
|
||
mkfifo -m 666 /tmp/logsuperd | ||
(cat <> /tmp/logsuperd | awk -v ENV="$ENV" -v USERTOKEN="$USERTOKEN" '{printf "supervisord;console;%s;%s;%s\n", ENV, USERTOKEN, $0; fflush()}' 1>/tmp/logpipe) & | ||
|
||
mkfifo -m 666 /tmp/logtomcat | ||
(cat <> /tmp/logtomcat | awk -v ENV="$ENV" -v USERTOKEN="$USERTOKEN" '{printf "tomcat;console;%s;%s;%s\n", ENV, USERTOKEN, $0; fflush()}' 1>/tmp/logpipe) & | ||
|
||
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf |
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
echo "Linking secrets and config files; using authentication: $AUTHENTICATION" | ||
ln -sf /run/secrets/m_sp-key.pem /etc/shibboleth/sp-key.pem | ||
ln -sf /run/secrets/m_host-key.pem /etc/pki/tls/private/host-key.pem | ||
ln -sf /etc/httpd/conf.d/midpoint.conf.auth.$AUTHENTICATION /etc/httpd/conf.d/midpoint.conf | ||
|
||
httpd-shib-foreground |