apt-get install --allow-unauthenticated -y make wget openjdk-8-jdk gcc libcurl4-openssl-dev python-pip bridge-utils apt-transport-https ca-certificates
pip install jsonschema
+# Install fd.io certificate
+HOST=nexus.fd.io
+PORT=443
+TRUST_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
+bash -c "echo -n | openssl s_client -showcerts -connect $HOST:$PORT 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' >> $TRUST_CERT_FILE"
+
# Download code for packet generator
mkdir /opt/honeycomb
cd /opt
apt-get install -y vpp vpp-dpdk-dkms vpp-lib vpp-dbg vpp-plugins vpp-dev
sleep 1
-# Install honeycomb restart script (workaround due to honeycomb file handle leak)
-cat > /etc/cron.hourly/honeycomb <<EOF
+# Install honeycomb restart script (workaround due to honeycomb shutdown: check every 5 minutes if it's still up)
+cat > /opt/start_honeycomb.sh <<EOF
#!/bin/bash
-VERSION=$(cat /opt/config/demo_artifacts_version.txt)
-pkill java
-/opt/honeycomb/sample-distribution-$VERSION/honeycomb &>/dev/null &disown
+PID=$(ps -u root | grep java | awk '{printf $1}')
+if [[ -z $PID ]]; then
+ VERSION=$(cat /opt/config/demo_artifacts_version.txt)
+ bash /opt/honeycomb/sample-distribution-$VERSION/honeycomb &>/dev/null &disown
+fi
EOF
-chmod +x /etc/cron.hourly/honeycomb
+chmod +x /opt/start_honeycomb.sh
+(crontab -l 2>/dev/null; echo "*/5 * * * * bash /opt/start_honeycomb.sh") | crontab -
# Run instantiation script
cd /opt