October 2018
Beginner to intermediate
736 pages
17h 39m
English
Linux distributions are moving away from their old System V-style startup processes to a newer mechanism, the systemd daemon, and its associated systemctl command-line tool. Services managed by systemd/systemctl require, at a minimum, a configuration file that defines startup and shutdown processes, a type definition that controls how those processes will be handled by the OS, and whatever executables are needed to start or stop the service processes. A bare-bones testdaemon.service configuration file could be as simple as the following:
[Unit] Description=testdaemon: a simple service example written in Python [Service] Type=forking ExecStart=/usr/bin/python /usr/local/bin/testdaemon.py ExecStop=/usr/bin/pkill ...