December 2018
Beginner
826 pages
22h 54m
English
We're going to write our own timer unit, using the Python unit file from the last example.
I would recommend starting by disabling the service if you've still got it running or destroying the VM and writing it again, referring to the last section if necessary.
Let's start by adjusting our pythonWebServer.service file so that it looks like the following:
[Unit]Description=Python Web Server ExampleDocumentation=man:python(1)ConditionFileNotEmpty=/var/www/html/index.html[Service]Type=simpleEnvironmentFile=/etc/sysconfig/pythonWebServerExecStart=/usr/bin/python2.7 -m SimpleHTTPServer $PORTWorkingDirectory=/var/www/html/
Specifically, we've removed a few lines. Note the complete removal of the [Install] section, as it's not needed ...