-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
11 changed files
with
161 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
midpoint/midpoint-server/container_files/supervisor/supervisord.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
37 changes: 37 additions & 0 deletions
37
midpoint/midpoint-server/container_files/usr-local-bin/send-tier-beacon.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
14 changes: 14 additions & 0 deletions
14
midpoint/midpoint-server/container_files/usr-local-bin/setup-cron.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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} |
28 changes: 28 additions & 0 deletions
28
midpoint/midpoint-server/container_files/usr-local-bin/start-all.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
8 changes: 8 additions & 0 deletions
8
midpoint/midpoint-server/container_files/usr-local-bin/start-httpd-shib.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters