Skip to content

Instantly share code, notes, and snippets.

@kidpixo
Forked from ewenchou/README.md
Last active September 26, 2017 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kidpixo/3ecf519414efb90d8bc2ad46f2ff7a3d to your computer and use it in GitHub Desktop.
Save kidpixo/3ecf519414efb90d8bc2ad46f2ff7a3d to your computer and use it in GitHub Desktop.
Run Python script as systemd service
  1. Create a service file like MYSERVICE.service
  2. Put it in /lib/systemd/system/
  3. Reload systemd using command: systemctl daemon-reload
  4. Enable auto start using command: systemctl enable MYSERVICE.service
  5. addon (thanks @nadrimajstor) : after network is up in [Unit]
[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