Skip to content
Snippets Groups Projects
metobs_api.service 647 B
[Unit]
Description=MetObs Data and File API (/opt/metobs/metobs_api)
Requires=metobs_api.socket
After=network.target

[Service]
PIDFile=/run/metobs_api/pid
User=daemon
Group=metobsgrp
RuntimeDirectory=metobs_api
WorkingDirectory=/tmp
Environment="METOBSAPI_SETTINGS=/home/metobs/metobs_api_settings.py"
ExecStart=/opt/metobs/metobs_api/bin/gunicorn --pid /run/metobs_api/pid   \
          --bind unix:/run/metobs_api/socket --workers 8 -n metobs_api   \
          --max-requests 1000 metobsapi.server:app
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
Restart=always

[Install]
WantedBy=multi-user.target