I have a problem running a Gunicorn Web service using Systemd.
Here are the files I created in order to execute:
The shell script file (/home/ubuntu/mata.sh):
#!/usr/bin/env bash
cd /home/ubuntu/workspace/test-api
/home/ubuntu/workspace/mata_venv/bin/gunicorn --workers=4 app:app --bind 0.0.0.0:xxxx
Here's my .service file (/lib/systemd/system/mata.service):
[Unit]
Description=Test API Service
After=multi-user.target
[email protected]
[Service]
User=ubuntu
Type=simple
ExecStart=/home/ubuntu/mata.sh
StandardInput=tty-force
[Install]
WantedBy=multi-user.target
Running the shell script on its own works well, but when running systemctl status mata.service, I am getting the following message:
Started Test API Service
mata.service: Main process exited, code=exited, status=216/GROUP
mata.service: Unit entered failed state.
mata.service: Failed with result 'exit-code'.
Any idea?