Installing python packages globally because it will make it easier to troubleshoot and start the services.

This commit is contained in:
Roland 2022-01-17 09:35:17 -07:00
parent 3ee34fef42
commit d255a0839c
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
3 changed files with 15 additions and 6 deletions

View file

@ -1,4 +1,4 @@
<html>
<html lang="en">
<body>
<h1>Error!</h1>
@ -8,9 +8,20 @@
<p><b>sudo systemctl status wrolpi-app</b></p>
<p><b>sudo systemctl status wrolpi-api</b></p>
<p>If either of those services are not running, start it:</p>
<br/>
<p>If either of those services are not running, start all WROLPi services:</p>
<p><b>sudo systemctl start wrolpi.target</b></p>
<br/>
<p>Or, start them individually:</p>
<p><b>sudo systemctl start wrolpi-app</b></p>
<p><b>sudo systemctl start wrolpi-api</b></p>
<hr/>
<h2>Can't start the services?</h2>
<p>You can view the media directory by <a href="/media">clicking here</a></p>
</body>
</html>

View file

@ -64,8 +64,6 @@ pip3 --version || (
curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py &&
python3 /tmp/get-pip.py
)
python3 -m venv /opt/wrolpi/venv
. /opt/wrolpi/venv/bin/activate
# Install python requirements files
pip3 install -r /opt/wrolpi/requirements.txt
@ -85,7 +83,7 @@ sudo -u postgres psql -c '\l' | grep wrolpi || (
sudo -u postgres createdb -O wrolpi wrolpi
)
# Initialize the WROLPi database.
(cd /opt/wrolpi && /opt/wrolpi/venv/bin/python3 /opt/wrolpi/main.py db upgrade)
(cd /opt/wrolpi && /usr/bin/python3 /opt/wrolpi/main.py db upgrade)
# Install the WROLPi nginx config over the default nginx config.
cp /opt/wrolpi/nginx.conf /etc/nginx/nginx.conf

View file

@ -5,7 +5,7 @@ PartOf=wrolpi.target
[Service]
Environment=PYTHONUNBUFFERED=1
ExecStart=/opt/wrolpi/venv/bin/python /opt/wrolpi/main.py api
ExecStart=/usr/bin/python3 /opt/wrolpi/main.py api
Group=wrolpi
User=wrolpi
WorkingDirectory=/opt/wrolpi/