In this section, we're going to put together a unit file of our own. We're also going to choose a location to save it and we're going to reboot our system to check if it works.
Writing a basic unit file
How to do it...
We're going to again use Python's built-in web server, starting an instance using a small unit file.
First, create the directory in which we're going to store our unit file:
$ sudo mkdir -p /usr/local/lib/systemd/system
Next, we're going to echo the following into a file called pythonWebServer.service:
$ sudo tee /usr/local/lib/systemd/system/pythonWebServer.service << HERE
[Unit]
Description=Python Web Server Example
[Service]
ExecStart=/usr/bin/python2.7 -m SimpleHTTPServer...