- Create a service file like
MYSERVICE.service
- Put it in
/lib/systemd/system/
- Reload
systemd
using command:systemctl daemon-reload
- Enable auto start using command:
systemctl enable MYSERVICE.service
- addon (thanks @nadrimajstor) : after network is up in [Unit]
-
-
Save kidpixo/3ecf519414efb90d8bc2ad46f2ff7a3d to your computer and use it in GitHub Desktop.
Run Python script as systemd service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=MYSERVICE service | |
Wants=network-online.target | |
After=network-online.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/dash_sniffer.py | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment