Skip to content
This repository was archived by the owner on Feb 9, 2021. It is now read-only.

Systemd

Spyros Roum edited this page Jul 23, 2020 · 1 revision

This assumes you have already installed the mneme api according to the instructions in the README

You have to create a mnemeapi.service file in /etc/systemd/system/ with the following: Do not forget to replace your username and group wherever necessary

[Unit]
Description=mneme api
After=network.target

[Service]
Environment=PATH=/home/YOUR_USER_NAME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Type=simple

# Your username and group
User=USER
Group=GROUP

# The path to the base directory for the API
WorkingDirectory=/PATH/TO/mneme-api
# Path to python usually is /usr/bin/python3 but you can find out by running
# $ which python3
# If the executable name is "python" then use that instead of "python3"
ExecStart=/PATH/TO/python /PATH/TO/mneme-api/mneme_api.py

KillSignal=SIGKILL
RestartKillSignal=SIGKILL
Restart=on-failure

[Install]
WantedBy=multi-user.target

After that you can enable and start the service with sudo systemctl enable --now mnemeapi

Clone this wiki locally