Embedded LinuxLinux

Recently when I  created the Qutipi linux distribution I had to select between the old-fashioned sysvinit and systemd. After a bit of research I decided to take the punt and use systemd. I choose systemd over sysvinit for a range of reasons such as the tooling is better (systemctl etc), greater error logging / reporting, more control over service groups etc.

I wrote a short post on using systemd mainly to jump-start people using QutiPi.

Overview

Systemd provides the base building blocks for a linux distribution, which allows bootstrapping of the user space and manages system processes.

Updating Service File

Systemd uses system files to determine how services are configured. These are located at /lib/systemd/system for Qutipi distro

You can modify any of these services, for example:

nano /lib/systemd/system/application-loader.service

Afterward i suggest running

systemctl daemon-reloadsystemctl restart application-loader

View Service’s Status

See the status of running services by running the below

systemctl status

See all systemd logs

Viewing logs for systemd event can be helpful to debug problems, for example to view all logs run

journalctl

Or we can tail the logs

journalctl -f

Or just show logs for one service

journalctl -u application-loader.service