June 2017
Intermediate to advanced
478 pages
13h 14m
English
Using the same simpleserver example as before, here is a service unit, which you will find in MELP/chapter_10/simpleserver-systemd:
[Unit] Description=Simple server [Service] Type=forking ExecStart=/usr/bin/simpleserver [Install] WantedBy=multi-user.target
The [Unit] section only contains a description so that it shows up correctly when listed using systemctl and other commands. There are no dependencies; as I said, it is very simple.
The [Service] section points to the executable and has a flag to indicate that it forks. If it were even simpler and ran in the foreground, systemd would do the daemonizing for us and Type=forking would not be needed.
The [Install] section creates an incoming dependency on multi-user.target ...
Read now
Unlock full access