View on GitHub

wiki

Systemd

Overview

Systemd is quickly becoming the new standard service manager for linux. It uses greatly simplified service descriptor files to handle daemon launching and management, and also has the advantage of using cgroups to silo everything.

Service files

Service files are of the following general format:

[Unit]
Description=VirtualBox Guest Service

[Service]
Type=simple
ExecStartPre=-/usr/bin/modprobe vboxguest
ExecStartPre=-/usr/bin/modprobe vboxvideo
ExecStartPre=-/usr/bin/modprobe vboxsf
ExecStart=/usr/bin/VBoxService -f
PIDFile= /var/run/vbox/vbox.pid

[Install]
WantedBy=multi-user.target

Service types

PID File

Use of PIDFile under Service is recommended for services where Type is set to forking. systemd will read the PID of the main process of the daemon after start-up of the service. systemd will not write to the file configured here, although it will remove the file after the service has shut down if it still exists.