Operations 5 min read

Trim Unneeded Systemd Services to Speed Up Linux Boot

This guide explains how to identify and disable unnecessary Systemd services on typical Linux distributions, using commands like systemctl, journalctl, and systemd-analyze, to streamline the boot process while avoiding side‑effects from static services.

ITPUB
ITPUB
ITPUB
Trim Unneeded Systemd Services to Speed Up Linux Boot

Most Linux distributions start a variety of services at boot, many of which you may never use (e.g., Bluetooth, Avahi, ModemManager, pppd‑dns). Systemd provides tools to view and control these services, allowing you to clean up the startup sequence on Systemd‑based systems.

Viewing Active Services

Instead of the traditional /etc/init.d approach, Systemd uses its own representation. The following commands list services that start during boot:

systemctl list-unit-files --type=service
systemctl list-units --type=service --state=running

These commands reveal entries such as the Bluetooth service, which you may want to disable.

Disabling a Service

To stop and prevent a service like Bluetooth from starting automatically, run:

sudo systemctl stop bluetooth.service
sudo systemctl disable bluetooth.service

After executing, verify the change with:

systemctl status bluetooth.service

Note that disabling may not be absolute because other services can reactivate it. Instead of uninstalling the package, you can mask the service to fully block it:

sudo systemctl mask bluetooth.service

Consider uninstalling only after confirming no adverse effects over a period of use.

Listing All Services

Use the following command to obtain a comprehensive list of services and their enabled/disabled state:

systemctl list-unit-files --type=service

Be aware that static services cannot be disabled because they are required by other units.

Analyzing Boot Performance

Systemd includes diagnostic tools to investigate boot issues. The command below reproduces all messages from the most recent boot:

journalctl -b -1

Replace -1 with -2, -3, etc., to view earlier boots. Since the output can be extensive, apply filters to focus on specific processes, e.g., filtering for PID 1.

Another useful tool is systemd-analyze blame, which lists services ordered by the time they took to start, helping you spot bottlenecks.

Key Takeaways

Identify unnecessary services based on your personal needs and disable or mask them.

Use systemctl commands to manage services safely.

Leverage journalctl and systemd-analyze to debug and optimize boot performance.

Static services cannot be disabled; they are required by other units.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

SysadminServicessystemd
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.