I am using systemd to start a python flask app on raspberry pi zero(Raspbian buster).
Every time I start a service, it launches two python processes instead of one. Why does this happen?
The first process is the parent of the second process.
Here is my service definition in /etc/systemd/system/website.service:
[Unit]
Description=Website
After=network.target
[Service]
User=root
WorkingDirectory=/home/pi/dev
ExecStart=python /home/pi/dev/app.py
Restart=always
[Install]
WantedBy=multi-user.target
Here is the flask app in /home/pi/dev/app.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return "Hello World!"
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True)