Created
May 25, 2016 13:24
-
-
Save funzoneq/737cd5316e525c388d51877fb7f542de to your computer and use it in GitHub Desktop.
A systemd file for a python SimpleHTTPServer
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=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 |
👍
mark
👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In case anyone is still not clear, here is exactly what I did:
1) Create the unit file
2) Detect your new service (twice you have to enter your password, and passwordless doesn't work...yuck)
3) Find out why it didn't start
4) Turns out I didn't use an absolute path to my binary
5) Try again
6) works
Credits: