Run Scripts using SystemD
Create an application execute script file
Create a systemd service unit file
/etc/systemd/system/myapp.service
[Unit]
Description=My Python Application
After=network.target
[Service]
User=root
Group=root
WorkingDirectory=/
ExecStart=/run-myapp.sh
Restart=always
StandardInput=null
StandardOutput=file:/app.log
StandardError=file:/app.log
[Install]
WantedBy=multi-user.target