Error running commands using shell although successfully run line by line manually
I'm using centos7 RHEL on vagrant virtualbox, I'm making a shell file that when I activate vagrant it runs the commands in the shell file on the virtual OS.
When I use SSH and run each line, it works but when I run it through the shell file it says No module named venv and venv is actually installed. I can't figure it out, please help. Thanks.
https://preview.redd.it/ow25ghgkz7g31.png?width=1068&format=png&auto=webp&s=290fca2a2ccd545bac93b606f7041d211c6fd9d4 install-shell.sh
sudo yum update sudo yum install epel-release -y sudo yum install centos-release-scl -y sudo yum install git wget ibxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel -y sudo yum groupinstall 'Development Tools' -y sudo useradd -m -U -r -d /opt/odoo -s /bin/bash odoo sudo -i sudo bash -c 'echo "odoo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers' ## Gist url echo -e "\n---- " export GIST_URL="https://gist.githubusercontent.com/Tarrasque18/c111670cb100b41bb6bf88064be9cc80/raw" export PERL_UPDATE_ENV="perl -p -e 's/\{\{([^}]+)\}\}/defined \$ENV{\$1} ? \$ENV{\$1} : \$&/eg' " [[ -z $SYSTEM ]] && echo "Don't forget to define SYSTEM variable" echo -e "\n---- Install Postpresql ----" sudo yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm sudo yum install -y postgresql11-server.x86_64 postgresql11-contrib.x86_64 sudo /uspgsql-11/bin/postgresql-11-setup initdb sudo systemctl start postgresql-11 sudo systemctl enable postgresql-11 # Create odoo user sudo su - postgres -c "createuser -s odoo" sudo su - postgres -c "createuser -s root" echo -e "\n---- Install wkhtmltox ----" sudo yum install -y https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm echo -e "\n---- Install Python 3 ----" sudo yum install -y centos-release-scl libxml2-devel libxslt-devel python-devel sudo yum install -y rh-python36 scl enable rh-python36 bash echo -e "\n---- Install Nginx ----" cd /etc/yum.repos.d/ wget -q ${GIST_URL}/nginx.repo -O nginx.repo sudo yum -y update sudo yum install nginx -y systemctl enable nginx service start nginx echo -e "\n---- Install Certbot ----" sudo yum -y install yum-utils sudo yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional sudo yum -y install python2-certbot-nginx echo -e "\n---- Install Odoo ----" sudo yum –y update cd /opt/odoo git clone https://www.github.com/odoo/odoo --depth 1 --branch 12.0 /opt/odoo/odoo echo -e "\n---- Upgrade pip ----" scl enable rh-python36 bash cd /opt/odoo python -m venv --without-pip odoo-venv source odoo-venv/bin/activate pip install --upgrade pip pip install wheel cd /opt/odoo pip install -r odoo/requirements.txt deactivate mkdir /opt/odoo/odoo-custom-addons sudo chown odoo: /opt/odoo/odoo-custom-addons echo -e "\n---- Odoo config ----" sudo yum -y install moreutils cd /etc/ sudo wget -q ${GIST_URL}/odoo.conf -O odoo.conf eval "${PERL_UPDATE_ENV} < odoo.conf" | sponge odoo.conf echo -e "\n---- Install and enable odoo service ----" cd /etc/systemd/system/ sudo wget -q ${GIST_URL}/odoo.service -O odoo.service systemctl daemon-reload systemctl start odoo systemctl enable odoo # Set enforce setenforce 0 echo -e "\n---- Config nginx ----" cd /etc/nginx/conf.d/ sudo wget -q ${GIST_URL}/nginx-odoo.conf -O odoo.conf eval "${PERL_UPDATE_ENV} < odoo.conf" | sponge odoo.conf systemctl restart nginx
submitted by
tarraskHAHA to
CentOS
haproxy inside podman trouble shooting
Hello!
I'm trying to setup haproxy to with podman and a few backend apache httpd processes. I'm having some trouble getting the haproxy that runs in a container to connect to the apache. I'm pretty new to podman.
I start my apache with something like:
podman run -d -h web -p 8080:80 httpd
then I can hit it with curl on the host and get the default html page. if I start haproxy on the host with:
[[email protected] podman]# haproxy -db -f haproxy.cfg [WARNING] 299/120251 (3510) : Server app/app2 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
then I can curl
http://localhost and get the html page returned (the app2 isn't started, so it throws that error)
Now If I start proxy inside a container:
[[email protected] podman]# podman run -p 80:80 haproxy [WARNING] 299/160449 (1) : Server app/app1 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 8ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. [WARNING] 299/160450 (1) : Server app/app2 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue. [ALERT] 299/160450 (1) : backend 'app' has no server available!
It can't reach any of my backend httpd containers but is listening on port 80. If I get it with curl it reflects that.
I feel like I'm missing some concept here. haproxy hits whatever fine outside the container. but inside it it doesn't work.
My very basic haproxy.cfg (minus the defaults: #--------------------------------------------------------------------- # main frontend which proxys to the backends #--------------------------------------------------------------------- frontend main *:80 default_backend app #--------------------------------------------------------------------- # round robin balancing between the various backends #--------------------------------------------------------------------- backend app balance roundrobin server app1 pod:8080 check server app2 pod:8081 check
Any advice on how to trouble shoot this is welcome.
oh my Dockerfile for haproxy.
FROM registry.access.redhat.com/ubi7/ubi RUN yum install -y haproxy iproute COPY haproxy.cfg /etc/haproxy/haproxy.cfg EXPOSE 80 ENTRYPOINT haproxy -db -f /etc/haproxy/haproxy.cfg
submitted by
mr804 to
podman