Removing bottlenecks
After identifying the bottlenecks responsible for slow boot times, you can use the systemctl command to stop and disable unwanted services. For instance, in the example discussed above, smdb, nmdb and networkmanager are some of the services that are holding back other services.
To stop these services and disable them so that they don’t start at boot, run the following commands:
$ sudo systemctl stop smdb
$ sudo systemctl disable smdb
The first command only stops the currently running service, but the second command ensures that the service won’t be started automatically at boot. However, even after you disable a service, you might still find it running during a subsequent reboot. This happens when another service depends on a disabled service and starts it. You can get a list of services that might start another service, for instance, smdb or snapd with the systemd-analyze blame | grep ≤service≥
command. For instance, the command systemd-analyze blame | grep snapd will display all the child services that need a parent service.
For a list of all enabled services, you can run the systemctl list-unitfiles | grep enabled command.
982f7286\x2d84f5\x2d48e5\ x2d807e\x2de208361fb≥
dev-disk-by\ x2duuid-982f7286\x2d84f5\ x2d48e5\x2d807e\x2de208361≥ lines 1-12/12 (END)
The data generated by systemdanalyze can be plotted into a graph for easy assimilation.
Run the systemd-analyze plot > /tmp/systemd-chart.svg command to generate a SVG chart in the /tmp directory. You can optionally create the chart in any other directory of your choice, if you wish to retain it for future reference.
The command create a SVG file, which is a text file that defines a series of graph vectors. This can
then be used by applications such as Image Viewer, Ristretto, LibreOffice Draw to generate a graph. These application can use the data in a SVG file to create an image.
The resulting graph is huge, and you have to zoom in considerably to be able to make sense of the presented data. The graph displays all the services that started at boot, as well as the time it took to start and all dependencies. The critical path for the different services is highlighted in red. Please read the man page of systemd-analyze if you wish to make the most of its capabilities for system manager debugging.