Can systemctl list all enabled services, including legacy services?
8
votes
2
answers
17127
views
[This question](https://askubuntu.com/questions/795226/how-to-list-all-enabled-services-from-systemctl) asks: "How to list all enabled services from systemctl?" Answers on that page include:
systemctl list-unit-files | grep enabled
systemctl list-unit-files --state=enabled
At least as of systemd version 229 (on Ubuntu 16.04),
systemctl list-unit-files
will not include "LSB" services that are launched via legacy init scripts.
Therefore, the original question seems to remain unanswered: Can systemd display a list of ALL the services (and other unit types) that it will try to start at boot, including legacy services?
Consider:
$ systemctl list-units | grep LSB | grep grub
grub-common.service loaded active exited LSB: Record successful boot for GRUB
$ systemctl list-unit-files | grep enabled | grep grub || echo 'nothing found'
nothing found
$ systemctl is-enabled grub-common
grub-common.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install is-enabled grub-common
enabled
systemctl
knows about grub-common
, and if you ask explicitly systemctl
will tell you it is enabled.
So... is there a way to get systemd to display a list of ALL the services it will attempt to run at boot, including legacy scripts?
Asked by mpb
(1831 rep)
Dec 17, 2017, 11:23 PM
Last activity: Oct 29, 2021, 07:23 AM
Last activity: Oct 29, 2021, 07:23 AM