Skip to content
Snippets Groups Projects
Commit f1079cfe authored by benedikt.kroening's avatar benedikt.kroening
Browse files

Did several changes to fix docker setup (tested on debian and centos)

Due to some different behavior of the distributions that may be used for docker setups it was necessary to implement some checks for supervisord and its configurations
parent 69d17892
No related branches found
No related tags found
1 merge request!7Issue16 7102
......@@ -117,4 +117,4 @@ echo "
</Proxy>
" > "${HTTPD_CONF_PATH}/${FILE_NAME}"
apachectl restart
\ No newline at end of file
restartService ${HTTPD}
\ No newline at end of file
[program:apache2]
autostart=true
command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND"
autostart=false
command=/bin/bash -c "[ -e /etc/apache2/envvars ] && source /etc/apache2/envvars || echo 'no envvars' && exec /usr/sbin/apache2 -DFOREGROUND"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
[program:httpd]
autostart=false
command=/bin/bash -c "exec /usr/sbin/httpd -DFOREGROUND"
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
......@@ -28,6 +28,7 @@ echo "0: "$0
echo "1: "$1
source /ox-installer/lib/common.bash
detectDistribution
# The interactive bash environment is for debugging and config evaluation ...
# Enter by:
......@@ -51,9 +52,14 @@ fi
# TODO:
if [[ "$1" == "supervisord" ]]; then
if [[ -z ${SUPERVISORD_CONF} ]]; then
echo "ERROR: There is a problem with determining the supervisord paths for config. Exitting"
exit 99
fi
echo "Starting supervisord services ..."
ls -lah /etc/supervisor/conf.d/
supervisord -c /etc/supervisor/supervisord.conf
ls -lah ${SUPERVISORD_CONF_D}
supervisord -c ${SUPERVISORD_CONF}
# wait for services to be available ...
sleep 10
......
......@@ -78,6 +78,8 @@ function detectDistribution {
export COMPATIBLE=true
fi
export DEBIAN_FRONTEND=noninteractive
export SUPERVISORD_CONF=/etc/supervisor/supervisord.conf
export SUPERVISORD_CONF_D=/etc/supervisor/conf.d
elif [[ -f /etc/SuSE-release ]]; then
# Installing wget to get buildkeys
zypper -n up
......@@ -173,6 +175,8 @@ function detectDistribution {
export DISTRO="RHEL7"
export COMPATIBLE=true
fi
export SUPERVISORD_CONF=/etc/supervisord.conf
export SUPERVISORD_CONF_D=/etc/supervisord.d
elif [[ -f /etc/os-release ]]; then
declare -A OSRELEASE
......
......@@ -796,29 +796,43 @@ function addOxBuildKey {
}
function preInstallActions {
echo "Executing preInstallActions ..."
ADDITIONAL_PACKAGES="gnupg2 curl wget"
if [[ true == "${ANY_DEB}" ]]; then
ADDITIONAL_PACKAGES="${ADDITIONAL_PACKAGES} apt-transport-https software-properties-common dirmngr netcat"
# Making MySQL installation unattended (Debian)
echo "mysql mysql-server/root_password string ${DATABASE_ROOT_PASS}" | debconf-set-selections
echo "mysql mysql-server/root_password_again string ${DATABASE_ROOT_PASS}" | debconf-set-selections
elif [[ true == "${ANY_RHEL}" ]] || [[ true == "${ANY_CENTOS}" ]]; then
ADDITIONAL_PACKAGES="${ADDITIONAL_PACKAGES} nc"
fi
if [[ -z ${EXECUTED_preInstallActions} ]]; then
echo "Executing preInstallActions ..."
ADDITIONAL_PACKAGES="gnupg2 curl wget"
if [[ true == "${ANY_DEB}" ]]; then
ADDITIONAL_PACKAGES="${ADDITIONAL_PACKAGES} apt-transport-https software-properties-common dirmngr netcat"
# Making MySQL installation unattended (Debian)
echo "mysql mysql-server/root_password string ${DATABASE_ROOT_PASS}" | debconf-set-selections
echo "mysql mysql-server/root_password_again string ${DATABASE_ROOT_PASS}" | debconf-set-selections
elif [[ true == "${ANY_RHEL}" ]] || [[ true == "${ANY_CENTOS}" ]]; then
ADDITIONAL_PACKAGES="${ADDITIONAL_PACKAGES} nc"
fi
if [[ "${INSTALL_TYPE}" == *"docker"* ]]; then
if [[ true == "${ANY_CENTOS}" ]]; then
echo "Adding epel repository for additional packages ..."
yum install epel-release -y
if [[ "${INSTALL_TYPE}" == *"docker"* ]]; then
if [[ true == "${ANY_CENTOS}" ]]; then
echo "Adding epel repository for additional packages ..."
yum install epel-release -y
fi
echo "Installing supervisor for service management ..."
ADDITIONAL_PACKAGES="supervisor ${ADDITIONAL_PACKAGES}"
fi
echo "Installing supervisor for service management ..."
ADDITIONAL_PACKAGES="supervisor ${ADDITIONAL_PACKAGES}"
installPackagesRetry "${ADDITIONAL_PACKAGES}"
if [[ "${INSTALL_TYPE}" == *"docker"* ]]; then
# do config here (debian located at /etc/supervisor; centos located at /etc/supervisord.conf)
echo "Copying supervisord config to distributions default location ..."
cp -au docker/_rootfs/etc/supervisor/supervisord.conf ${SUPERVISORD_CONF}
#cp -au docker/_rootfs/etc/supervisor/conf.d/* ${SUPERVISORD_CONF_D}/
fi
export EXECUTED_preInstallActions=true
else
echo "preInstallActions already done ..."
fi
installPackagesRetry "${ADDITIONAL_PACKAGES}"
export EXECUTED_preInstallActions=true
}
......
......@@ -118,10 +118,8 @@ echo "=== (CTRL+C to cancel) ==="
sleep 3
if [[ -z ${EXECUTED_preInstallActions} ]]; then
preInstallActions
fi
preInstallActions
if [[ "${DATABASE_TYPE}" == "mysql" ]]; then
echo "Installing mysql-server packages..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment