Debugging Central

This page is part of the debugging series — pages with debugging details for a variety of Ubuntu packages.

Identifying the culprit

Systemd is not especially complex software, but there is some complexity in figuring out what to debug, based on the type of problem at hand.

Pick from the table below the systemd component to look at:

Type of problem

systemd component

network addresses (missing IP, can't ping 8.8.8.8. etc.)

systemd-networkd

cannot resolve addresses (nslookup google.com fails)

systemd-resolved

incorrect time, time not syncing to NTP

systemd-timesyncd

devices not showing up as expected

systemd-udevd

system log issues

systemd-journald

issues in text-based terminal (VTs, not in graphical mode)

systemd-logind

daemons, applications not starting at boot or at login

systemd

General debugging steps

Debugging systemd components

systemd-networkd : network issues

To further find out what may be going wrong with systemd-networkd, you can also stop it, and restart it in debug mode, like so:

sudo systemctl stop systemd-networkd
SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-networkd

The daemon will start in the foreground and output everything on console, with many details. These can be used by developers to identify what is going wrong.

systemd-resolved : DNS resolution issues

To further find out what may be going wrong with systemd-resolved, you can also stop it, and restart it in debug mode, like so:

sudo systemctl stop systemd-resolved
SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-resolved

Then attempt to resolve the address again, watching for the messages displayed on the console; there will be lots of information that a developer can use to make sense of the issue, whether it is a bug, DNSSEC problem, etc.

systemd-timesyncd : time synchronization issues

You can restart systemd-timesyncd in debug mode and watch for the messages for issues:

sudo systemctl stop systemd-timesyncd
SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-timesyncd

systemd-udevd

You can attempt to reproduce the issue by unplugging the affected device; then starting the udev monitor:

udevadm monitor

Replug the affected device, and make sure to include the output in your bug report.

systemd-journald

TBD

systemd-logind

systemd : daemon, app startup issues

Verify whether the system's state is running according to systemd:

systemctl is-system-running

List the systemd units on the system, including any possible failed ones (which might not be an issue at all):

systemctl list-units

Check the logs for a systemd unit:

journalctl -u  xyz

DebuggingSystemd (last edited 2018-05-11 16:17:31 by cyphermox)