[Unit] Description=A Python project. After=syslog.target network.target [Service] Type=simple Restart=on-failure StartLimitBurst=2 # Restart, but not more than once every x seconds: 30=30s, 600=10m StartLimitInterval=30 WorkingDirectory={{ repo_dir }}{{ item }} ExecStart={{ repo_dir }}{{ item }}/venv/bin/python {{ repo_dir }}{{ item }}/main.py User={{ user }} StandardOutput=syslog StandardError=syslog SyslogIdentifier= {{ item }} [Install] WantedBy=multi-user.target