Commit 96166356 authored by cdanger's avatar cdanger
Browse files

Merge branch 'master' of https://github.com/authzforce/fiware.git

parents e1c5fc82 97c9c73e
#!/bin/bash -ex
# As a guideline to do an unattended installation, see http://www.microhowto.info/howto/perform_an_unattended_installation_of_a_debian_package.html
# The script is aborted if any command fails. If it is OK that a comand fails,
# use ./mycomand || true
export DEBIAN_FRONTEND=noninteractive
sudo apt-get --assume-yes -qq update
sudo apt-get --assume-yes -qq install gdebi curl
curl --silent --remote-name --location http://authzforce.github.io/fiware/dist/authzforce_latest_all.deb > /dev/null
sudo gdebi --quiet --non-interactive authzforce_latest_all.deb
#!/bin/bash -ex
# As a guideline to do an unattended installation, see http://www.microhowto.info/howto/perform_an_unattended_installation_of_a_debian_package.html
# The script is aborted if any command fails. If it is OK that a comand fails,
# use ./mycomand || true
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get update --assume-yes -qq
sudo -E apt-get install --assume-yes -qq gdebi curl debconf-utils
sudo curl --silent --remote-name --location http://authzforce.github.io/fiware/dist/authzforce_latest_all.deb
# Prevent Tomcat restart before change to JAVA_OPTS applied later
sudo bash -c "echo authzforce authzforce/restartTomcat boolean false | debconf-set-selections"
sudo bash -c "echo authzforce authzforce/keepSamples boolean true | debconf-set-selections"
sudo -E gdebi --quiet --non-interactive authzforce_latest_all.deb
# FIX issue with Tomcat (very) slow startup on Linux KVM since kernel 3.13:
# https://ask.openstack.org/en/question/51617/launching-apache-tomcat-inside-vm-takes-up-to-47-minutes/
# https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1269073 - Long-term fix not yet available
# WORKAROUND used here: see stackoverflow discussion linked from https://ask.openstack.org/en/question/51617/launching-apache-tomcat-inside-vm-takes-up-to-47-minutes/
sudo sed -i 's|^JAVA_OPTS\s*=.*$|JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xms1024m -Xmx1024m -XX:+UseConcMarkSweepGC -XX:MaxNewSize=384m -XX:MaxPermSize=128m -server"|' /etc/default/tomcat7
sudo service tomcat7 restart
#!/bin/bash -ex
# The script is aborted if any command fails. If it is OK that a comand fails,
# use ./mycomand || true
# log into the VM and check the service
# use debian user for Debian7, ubuntu por Ubuntu12.04/Ubuntu14.04, centos for Centos6/Centos7
ssh ubuntu@$IP sudo /usr/sbin/service tomcat7 status | grep --quiet "running"
# Check that AuthzForce webapp is up and running
# Wait for 20 sec max and check every 5 sec
max_iterations=3
iterations=0
until [[ "`curl --silent --show-error --connect-timeout 5 --max-time 10 --request GET http://$IP:8080/authzforce/domains | grep 'resources'`" != "" || $iterations > $max_iterations ]];
do
echo --- waiting 5 more seconds for Authzforce app to start
sleep 5
let "iterations=iterations+1"
done
if [ $iterations -gt $max_iterations ]
then
echo "AuthzForce startup seems to have failed as it is unreachable at this url 'http://$IP:8080/authzforce/domains', please check /var/log/tomcat7/authzforce/error.log"
else
echo AuthZForce is ready!
fi
#!/bin/bash -ex
# The script is aborted if any command fails. If it is OK that a comand fails,
# use ./mycomand || true
# log into the VM and check the service
# use debian user for Debian7, ubuntu por Ubuntu12.04/Ubuntu14.04, centos for Centos6/Centos7
# Check that AuthzForce webapp is up and running
# Wait for 20 sec max and check every 5 sec
max_iterations=5
iterations=0
until [[ "`curl --silent --show-error --connect-timeout 5 --max-time 10 --request GET http://$IP:8080/authzforce/domains | grep 'resources'`" != "" || $iterations -gt $max_iterations ]];
do
echo --- waiting 5 more seconds for Authzforce app to start
sleep 5
let "iterations=iterations+1"
echo "Status check $iterations/$max_iterations"
done
if [[ $iterations -gt $max_iterations ]]
then
echo "AuthzForce startup seems to have failed, OR the Tomcat server was stopped, OR network filtering measures are blocking the HTTP request, as it is unreachable at URL 'http://$IP:8080/authzforce/domains', please check /var/log/tomcat7/authzforce/error.log"
else
echo AuthZForce is ready!
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment