Skip to content

Instantly share code, notes, and snippets.

@cr3a7ure
Forked from funzoneq/simplehttp.service
Created May 21, 2022 13:03
Show Gist options
  • Save cr3a7ure/052be9b25625eaaf8dc7a3e796e9d639 to your computer and use it in GitHub Desktop.
Save cr3a7ure/052be9b25625eaaf8dc7a3e796e9d639 to your computer and use it in GitHub Desktop.
A systemd file for a python SimpleHTTPServer
[Unit]
Description=Job that runs the python SimpleHTTPServer daemon
Documentation=man:SimpleHTTPServer(1)
[Service]
Type=simple
WorkingDirectory=/tmp/letsencrypt
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 &
ExecStop=/bin/kill `/bin/ps aux | /bin/grep SimpleHTTPServer | /bin/grep -v grep | /usr/bin/awk '{ print $2 }'`
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment