Run a python app (or script) as a systemd service - ilylabs
ilylabs.github.io › posts › python-systemdMay 08, 2020 · This post shows how you could run a python script on a Raspberry Pi as a systemd service that is running Debian. This method will also work with a laptop or computer running Ubuntu or Debian. Running as a script a systemd service means that the script will automatically run when the machine boots and it will be restarted even if it crashes for any reason. Basically, it will be running forever ...
systemd - PyPI
https://pypi.org/project/systemd01.03.2018 · Python systemd wrapper using Cython Installation You should install systemd headers For debian users: apt-get install build-essential \ libsystemd-journal-dev \ libsystemd-daemon-dev \ libsystemd-dev For CentOS/RHEL yum install gcc systemd-devel And install it from pypi pip install systemd Usage examples Systemd daemon notification