|
@ -84,22 +84,24 @@ if [[ -e /etc/os-release ]]; then |
|
|
|
|
|
|
|
|
if [[ $INSTALL_DATABASE -eq 1 ]]; then |
|
|
if [[ $INSTALL_DATABASE -eq 1 ]]; then |
|
|
if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then |
|
|
if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then |
|
|
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server python-mysqldb |
|
|
|
|
|
|
|
|
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server python3-mysqldb |
|
|
# HSFD changes for Ubuntu 18.04 |
|
|
# HSFD changes for Ubuntu 18.04 |
|
|
sudo sed -i -e "/bind-address/d" /etc/mysql/mysql.conf.d/mysqld.cnf |
|
|
|
|
|
#sudo sed -i -e "/bind-address/d" /etc/mysql/my.cnf |
|
|
|
|
|
sudo service mysql restart |
|
|
|
|
|
|
|
|
#sudo sed -i -e "/bind-address/d" /etc/mysql/mysql.conf.d/mysqld.cnf |
|
|
|
|
|
##sudo sed -i -e "/bind-address/d" /etc/mysql/my.cnf |
|
|
|
|
|
sudo sed -i -e "s/127.0.0.1/0.0.0.0/g" /etc/mysql/mariadb.conf.d/50-server.cnf |
|
|
|
|
|
sudo mysqladmin password password |
|
|
|
|
|
sudo systemctl restart mariadb |
|
|
elif [[ $ID = 'fedora' ]]; then |
|
|
elif [[ $ID = 'fedora' ]]; then |
|
|
# fedora currently not tested nor supported |
|
|
# fedora currently not tested nor supported |
|
|
sudo dnf install -y mariadb-server python-mysql |
|
|
|
|
|
|
|
|
sudo dnf install -y mariadb-server python3-mysql |
|
|
printf "[mysqld]\nbind-address = 127.0.0.1\n" | sudo tee /etc/my.cnf.d/faafo.conf |
|
|
printf "[mysqld]\nbind-address = 127.0.0.1\n" | sudo tee /etc/my.cnf.d/faafo.conf |
|
|
|
|
|
sudo mysqladmin password password |
|
|
sudo systemctl enable mariadb |
|
|
sudo systemctl enable mariadb |
|
|
sudo systemctl start mariadb |
|
|
sudo systemctl start mariadb |
|
|
else |
|
|
else |
|
|
echo "error: distribution $ID not supported" |
|
|
echo "error: distribution $ID not supported" |
|
|
exit 1 |
|
|
exit 1 |
|
|
fi |
|
|
fi |
|
|
sudo mysqladmin password password |
|
|
|
|
|
sudo mysql -uroot -ppassword mysql -e "CREATE DATABASE IF NOT EXISTS faafo; GRANT ALL PRIVILEGES ON faafo.* TO 'faafo'@'%' IDENTIFIED BY 'password';" |
|
|
sudo mysql -uroot -ppassword mysql -e "CREATE DATABASE IF NOT EXISTS faafo; GRANT ALL PRIVILEGES ON faafo.* TO 'faafo'@'%' IDENTIFIED BY 'password';" |
|
|
URL_DATABASE='mysql://root:password@localhost/faafo' |
|
|
URL_DATABASE='mysql://root:password@localhost/faafo' |
|
|
fi |
|
|
fi |
|
@ -124,8 +126,7 @@ if [[ -e /etc/os-release ]]; then |
|
|
|
|
|
|
|
|
if [[ $INSTALL_FAAFO -eq 1 ]]; then |
|
|
if [[ $INSTALL_FAAFO -eq 1 ]]; then |
|
|
if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then |
|
|
if [[ $ID = 'ubuntu' || $ID = 'debian' ]]; then |
|
|
# TODO: needs to be updated for Ubuntu >= 20.04 |
|
|
|
|
|
sudo apt-get install -y python-dev python-pip supervisor git zlib1g-dev libmysqlclient-dev python-mysqldb |
|
|
|
|
|
|
|
|
sudo apt-get install -y python3-dev python3-pip supervisor git zlib1g-dev libmysqlclient-dev python3-mysqldb python-is-python3 |
|
|
# Following is needed because of |
|
|
# Following is needed because of |
|
|
# https://bugs.launchpad.net/ubuntu/+source/supervisor/+bug/1594740 |
|
|
# https://bugs.launchpad.net/ubuntu/+source/supervisor/+bug/1594740 |
|
|
if [ $(lsb_release --short --codename) = xenial ]; then |
|
|
if [ $(lsb_release --short --codename) = xenial ]; then |
|
@ -140,7 +141,7 @@ if [[ -e /etc/os-release ]]; then |
|
|
fi |
|
|
fi |
|
|
elif [[ $ID = 'fedora' ]]; then |
|
|
elif [[ $ID = 'fedora' ]]; then |
|
|
# fedora currently not tested nor supported |
|
|
# fedora currently not tested nor supported |
|
|
sudo dnf install -y python-devel python-pip supervisor git zlib-devel mariadb-devel gcc which python-mysql |
|
|
|
|
|
|
|
|
sudo dnf install -y python3-devel python3-pip supervisor git zlib-devel mariadb-devel gcc which python3-mysql |
|
|
sudo systemctl enable supervisord |
|
|
sudo systemctl enable supervisord |
|
|
sudo systemctl start supervisord |
|
|
sudo systemctl start supervisord |
|
|
#elif [[ $ID = 'opensuse' || $ID = 'sles' ]]; then |
|
|
#elif [[ $ID = 'opensuse' || $ID = 'sles' ]]; then |
|
@ -162,7 +163,7 @@ if [[ -e /etc/os-release ]]; then |
|
|
sudo mkswap /swap |
|
|
sudo mkswap /swap |
|
|
sudo swapon /swap |
|
|
sudo swapon /swap |
|
|
sudo pip install -r requirements.txt |
|
|
sudo pip install -r requirements.txt |
|
|
sudo python setup.py install |
|
|
|
|
|
|
|
|
sudo python3 setup.py install |
|
|
|
|
|
|
|
|
sudo sed -i -e "s#transport_url = .*#transport_url = $URL_MESSAGING#" /etc/faafo/faafo.conf |
|
|
sudo sed -i -e "s#transport_url = .*#transport_url = $URL_MESSAGING#" /etc/faafo/faafo.conf |
|
|
sudo sed -i -e "s#database_url = .*#database_url = $URL_DATABASE#" /etc/faafo/faafo.conf |
|
|
sudo sed -i -e "s#database_url = .*#database_url = $URL_DATABASE#" /etc/faafo/faafo.conf |
|
|