You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2018/12/12 16:59:46 UTC

[trafficcontrol] 01/04: CIAB: Misc Fixes for Traffic Router and CIAB startup * CIAB-TrafficRouter: Remove debug version of java-1.8.0 jdk, * CIAB-TrafficRouter: Fix symlink from /usr/lib/jvm/java-1.8.0* -> /opt/java * CIAB-ToAccess.sh: Add ${ENROLLER_DIR}/servers dir creation/validation for to-enroll() * CIAB-ToAccess.sh: Add sync to to-enroll() to make /shared directory flush/update faster

This is an automated email from the ASF dual-hosted git repository.

mitchell852 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit a876c2e76673f8047b94b958622ae4145535a96d
Author: Jeffrey Bevill <Je...@comcast.com>
AuthorDate: Fri Dec 7 08:39:11 2018 -0700

    CIAB: Misc Fixes for Traffic Router and CIAB startup
    * CIAB-TrafficRouter: Remove debug version of java-1.8.0 jdk,
    * CIAB-TrafficRouter: Fix symlink from /usr/lib/jvm/java-1.8.0* -> /opt/java
    * CIAB-ToAccess.sh: Add ${ENROLLER_DIR}/servers dir creation/validation for to-enroll()
    * CIAB-ToAccess.sh: Add sync to to-enroll() to make /shared directory flush/update faster
---
 infrastructure/cdn-in-a-box/traffic_ops/to-access.sh  | 7 +++++--
 infrastructure/cdn-in-a-box/traffic_router/Dockerfile | 5 ++---
 infrastructure/cdn-in-a-box/traffic_router/run.sh     | 5 +++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/infrastructure/cdn-in-a-box/traffic_ops/to-access.sh b/infrastructure/cdn-in-a-box/traffic_ops/to-access.sh
index 21fa5fc..60cf3aa 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/to-access.sh
+++ b/infrastructure/cdn-in-a-box/traffic_ops/to-access.sh
@@ -137,8 +137,9 @@ to-delete() {
 to-enroll() {
 
 	while true; do
-		[ -d "$ENROLLER_DIR" ] && break
-		echo "Waiting for $ENROLLER_DIR ..."
+		[ -d "${ENROLLER_DIR}/servers" ] && break
+		echo "Waiting for ${ENROLLER_DIR}/servers ..."
+		sync 
 		sleep 2
 	done
 
@@ -146,6 +147,7 @@ to-enroll() {
 		echo "${ENROLLER_DIR}/servers not found -- contents:"
 		find ${ENROLLER_DIR} -ls
 	fi
+
 	local serverType="$1"
 
 	if [[ ! -z "$2" ]]; then
@@ -241,6 +243,7 @@ to-enroll() {
 	esac
 
 	# replace env references in the file
+	mkdir -p ${ENROLLER_DIR}/servers
 	envsubst < "/server_template.json" > "${ENROLLER_DIR}/servers/$HOSTNAME.json"
 
 	sleep 3
diff --git a/infrastructure/cdn-in-a-box/traffic_router/Dockerfile b/infrastructure/cdn-in-a-box/traffic_router/Dockerfile
index af379b3..59a096d 100644
--- a/infrastructure/cdn-in-a-box/traffic_router/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_router/Dockerfile
@@ -29,10 +29,9 @@ ARG TOMCAT_RPM=traffic_router/tomcat.rpm
 RUN yum -y install epel-release git rpm-build net-tools iproute nc wget tar unzip \
           perl-JSON perl-WWWCurl which make autoconf automake gcc gcc-c++ apr apr-devel \
           openssl openssl-devel bind-utils net-tools perl-JSON-PP gettext \
-          java-1.8.0-openjdk-devel-debug.x86_64 \
-          java-1.8.0-openjdk && \ 
+          java-1.8.0-openjdk-headless java-1.8.0-openjdk-devel && \
     yum -y clean all && \
-    ln -s /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.*.el7_5.x86_64-debug /opt/java
+    ln -sfv $(find /usr/lib/jvm -type d -name 'java-1.8.0*openjdk*') /opt/java
 
 ADD $TRAFFIC_ROUTER_RPM /traffic_router.rpm
 ADD $TOMCAT_RPM /tomcat.rpm
diff --git a/infrastructure/cdn-in-a-box/traffic_router/run.sh b/infrastructure/cdn-in-a-box/traffic_router/run.sh
index fbc41f5..88f1918 100755
--- a/infrastructure/cdn-in-a-box/traffic_router/run.sh
+++ b/infrastructure/cdn-in-a-box/traffic_router/run.sh
@@ -65,8 +65,6 @@ cp $X509_CA_CERT_FILE $CATALINA_BASE/conf
 cp $X509_CA_CERT_FILE /etc/pki/ca-trust/source/anchors
 update-ca-trust extract
 
-# Enroll Traffic Router
-to-enroll tr || (while true; do echo "enroll failed."; sleep 3 ; done)
 
 # Add traffic 
 for crtfile in $(find $CATALINA_BASE/conf -name \*.crt -type f) 
@@ -100,6 +98,9 @@ until nc $TM_FQDN $TM_PORT </dev/null >/dev/null 2>&1; do
   sleep 3
 done
 
+# Enroll Traffic Router
+to-enroll tr || (while true; do echo "enroll failed."; sleep 3 ; done)
+
 touch $LOGFILE $ACCESSLOG
 tail -F $CATALINA_OUT $CATALINA_LOG $LOGFILE $ACCESSLOG &