systemd is a set of tools managing, among other things, the startup procedure on Linux systems. Within the Linux user and developer community, there is a debate whether systemd violates the Unix philosophy - however, it works well for starting all the software components we need when booting the server or the Access Points.
System services can be started in dependence of other services, making it possible to launch a system in with many interrelations. They can be started and stopped during operation. Depending on the configuration, services can also be restarted automatically when crashing.
systemd services can be declared as user services or system services. They are defined in text files, which need to be located in one of the the following directories:
The JACK Service
The JACK service needs to be started before all other audio applications, since they rely on a running JACK server. A file jack.service defines the complete service:
[Unit] Description=Jack audio server After=sound.target local-fs.target [Install] WantedBy=multi-user.target [Service] Type=simple PrivateTmp=true Environment="JACK_NO_AUDIO_RESERVATION=1" ExecStart=/usr/bin/jackd -P 90 -a a -d dummy -p 128 LimitRTPRIO=95 LimitRTTIME=infinity LimitMEMLOCK=infinity User=studio
Once the service files are in place, several simple commands are available for controlling them. They differ, depending on whether a user service or system service is controlled. The following examples refer to the JACK user service. Controlling system services requires root privileges and do not need the --user flag.
Activating a Service
Activating a service creates a symlink in ~/.config/systemd/user/multi-user.target.wants/jack.service, pointing to the original file /usr/lib/systemd/user/jack.service. Afterwards, the system is launched on every boot.
Getting a Service's Status
The following command prints a system's status:
When the JACK sevice has been started sucessfully, the output looks as follows:
● jack.service - Jack audio server Loaded: loaded (/usr/lib/systemd/user/jack.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2021-04-13 23:00:14 BST; 3s ago Main PID: 214518 (jackd) CGroup: /firstname.lastname@example.org/jack.service └─214518 /usr/bin/jackd -P 90 -a a -d dummy -p 256