Some people love systemd and can’t stop raving about it; others love to hate it and can’t stop throwing shade at it. Even though systemd remains divisive, one thing’s for sure: since nearly all modern Linux distributions have adopted it as their default init system, learning to use it can pay off big time. Here’s a basic overview of how to use four systemd tools that make troubleshooting on Linux a breeze.
Systemctl: The modern way to manage services
Systemctl is the gateway to service management on systemd-based Linux distributions. It can start and stop services, restart or reload them, enable or disable them, and help you learn so much more about the status of the different services on your system. Checking the status of a particular service is usually the first step in troubleshooting. You can use systemctl to show all running service units:
systemctl list-units --type=service
The state option can tell you more about failed services:
systemctl list-units --state=failed
You can also list active and inactive service units:
systemctl list-unit-files --type=service
Want to check the status of a specific service, such as a custom wallpaper changer? Ask systemctl for a status update. You can also check if a service will auto-start whenever you boot and reboot, and if it’s not enabled, you can easily enable it:
systemctl status wallpaper-changersystemctl is-enabled [service name]Starting, stopping, and restarting a service is also a breeze with systemctl. The start option is the easiest way to start a service. If a service is not running at boot time, you can enable it, and if you don’t want a service to start at boot time, you can disable it:
sudo systemctl start [name of service]sudo systemctl enable [service name.service]sudo systemctl disable [service name.service]For help, use:
systemctl --help
Journalctl: Making sense of service logs
Systemctl is a quick way to manage and troubleshoot services. But if you’re looking for more information about a service, journalctl is the tool for the job. Journalctl is easy to use; it lets you dive deeper into a service’s log, which is usually a treasure trove of information.
The primary way I use it is to filter the log file output for a specific service. For example, I can use it to show only the log file of the custom wallpaper changer I automated with a systemd timer.
journalctl -u wallpaper-changer.service
Build an “infinite desktop” on Ubuntu with Python and a systemd timer
Pull fresh Unsplash wallpapers and rotate them on GNOME automatically with a Python script plus a systemd service and timer.
You can use it to show multiple log files of specific service units, depending on the service you’re troubleshooting. For narrower results, use date and time filters to limit the log file output, which is usually a good way to determine when a service error occurred or when it started. For example, you can use the ‘since’ option to show logs using relative and exact time:
journalctl -u wallpaper-changer –since "3 hours ago"
journalctl -u wallpaper-changer "2025-02-01 15:00:00" -n 10
You can also show the log file of the current and previous boot sessions:
journalctl -b
journalctl -b -1
To show a service’s log in real-time, use the f option to follow it.
journalctl -u wallpaper-changer.service -f
To troubleshoot services that have failed to start, use:
journalctl -xe
You can also limit the number of lines in a log file or show the log entries from the newest to the oldest:
journalctl -u wallpaper-changer.service -r -n20For help, use:
journalctl --help
Systemd-analyze: Discover the services slowing down your computer
Is your Linux system booting slower than a snail on a hot, dry day? If it is, systemd-analyze is the tool for you. You can use it to understand how the various services on your computer impact boot time. That means you can use it to identify services or configuration errors that may be slowing down system startup. The first way to use it is by analyzing the overall boot time:
systemd-analyze
- Kernel: This is the time the system has spent initializing system drivers and hardware.
- Userspace: This represents the time taken to initialize and start services.
If you suspect that a service is causing your system to boot slowly, but you’re not sure which service could be causing it, you can analyze services based on how much time they contribute to the boot time:
systemd-analyze blame
The basic visualization features in systemd-analyze can print out a simple graphical timeline or chart of the services that start during and after the boot sequence.
systemd-analyze critical-chainsystemd-analyze plot > boot.svgSystemd-analyze plot > boot.svg creates an SVG chart of all system services and saves it in your home folder. Drag and drop the SVG in your browser to view it. Services with the longest bars take the longest to load. Troubleshoot those first.
For help, use:
systemd-analyze --help
Coredumpctl: Inspect crash reports
If some services keep crashing randomly or unexpectedly, coredumpctl can help you inspect, troubleshoot, and resolve the issue. However, if you’ve never used coredumpctl, it may be unavailable on your device. Install it by updating your system and executing sudo apt install systemd-coredump. Once installed, you can use the list option to see a table of all crashed services and processes:
coredumpctl list
To inspect and troubleshoot a particular crash, use its Process ID:
coredumpctl info 9381
If you’re troubleshooting a particular program or service, filter for that specific program/service:
coredumpctl list [program name/PID]
For help, use:
coredumpctl –helpSystemd has many other tools and features. It can also do so much more. Ultimately, experimenting with these four systemd tools is a small step towards becoming a pro at troubleshooting Linux programs and services.





