How to Trim Unnecessary Linux Startup Services with Systemd
This guide explains why many Linux distributions start unused services at boot, and shows step‑by‑step how to list, disable, mask, and verify unwanted systemd services—such as Bluetooth—while also providing commands to inspect boot logs and identify slow‑starting units.
Most Linux distributions launch a large number of services during boot, many of which you never use (e.g., Bluetooth, Avahi, modem managers, pppd‑dns). These unnecessary processes can waste resources and slow down startup.
Viewing Enabled Services with Systemd
Systemd replaces the traditional /etc/init.d approach with its own set of commands. To see which services are enabled, you can run:
systemctl list-unit-files --type=service --state=enabledor use the graphical list shown in the article (image below).
Disabling an Unwanted Service (Example: Bluetooth)
If you identify a service you don’t need, such as bluetooth.service, you can stop it and prevent it from starting on future boots:
sudo systemctl stop bluetooth.service
sudo systemctl disable bluetooth.serviceTo ensure it cannot be re‑enabled by other units, mask it: sudo systemctl mask bluetooth.service After performing these steps, verify the change with:
systemctl is-enabled bluetooth.serviceStatic Services and Limitations
Some services are marked as static because other units depend on them; their enable/disable state cannot be changed directly. Attempting to modify such services will have no effect.
Inspecting Boot Logs
Systemd’s journalctl command lets you replay boot messages. Use journalctl -b -1 to view the previous boot, -b -2 for the one before that, and so on. Because the full log can be noisy, you can filter it—for example, to focus on messages from PID 1:
journalctl -b -1 _PID=1Finding Slow‑Starting Units
The systemd-analyze blame command lists services ordered by the time they took to start, helping you pinpoint bottlenecks:
systemd-analyze blameIf a service consistently appears at the top, consider disabling or optimizing it as shown earlier.
Conclusion
By using systemd’s tooling— systemctl to list and manage services, journalctl to review boot logs, and systemd-analyze to spot slow units—you can safely prune unnecessary startup processes, improve boot speed, and keep your Linux system lean.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
