Listar todos os serviços do Systemd

Confira nessa matéria como listar e ver o estado dos serviços que são carregados pelo systemd e com isso poder resolver possíveis problemas.









Essa matéria não vem com solução para problemas, o intuito aqui é apenas mostrar uma forma de identificar problemas e tentar resolver.


Listar todos os serviços do Systemd



Para listar todos os servições de o comando abaixo no terminal.

systemctl list-unit-files --type service --all
Caso queira a lista completa em um arquivo de texto você pode usar o comando abaixo e ira ter um arquivo na sua home de nome list-systemd.

systemctl list-unit-files --type service --all > list-systemd


Note na listagem abaixo que temos os estados:

Enable
Static
Masked
Disabled
Indirect
Generated

No caso de problemas os servições podem apresentar os estados Masked ou Disabled.


UNIT FILE STATE
accounts-daemon.service enabled
alsa-restore.service static
alsa-state.service static
alsa-utils.service masked
anacron.service enabled
apparmor.service enabled
apt-daily-upgrade.service static
apt-daily.service static
autovt@.service enabled
avahi-daemon.service enabled
bluetooth.service enabled
clean-mount-point@.service static
colord.service static
configure-printer@.service static
console-getty.service disabled
console-setup.service enabled
container-getty@.service static
cron.service enabled
cryptdisks-early.service masked
cryptdisks.service masked
cups-browsed.service enabled
cups.service enabled
dbus-fi.w1.wpa_supplicant1.service enabled
dbus-org.bluez.service enabled
dbus-org.freedesktop.Avahi.service enabled
dbus-org.freedesktop.hostname1.service static
dbus-org.freedesktop.locale1.service static
dbus-org.freedesktop.login1.service static
dbus-org.freedesktop.ModemManager1.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
dbus-org.freedesktop.timedate1.service static
dbus-org.freedesktop.timesync1.service enabled
dbus.service static
debug-shell.service disabled
display-manager.service indirect
e2scrub@.service static
e2scrub_all.service static
e2scrub_fail@.service static
e2scrub_reap.service enabled
emergency.service static
flatpak-system-helper.service static
fstrim.service static
gdomap.service generated
geoclue.service static
getty-static.service static
getty@.service enabled
haveged.service enabled
hwclock.service masked
ifup@.service static
ifupdown-pre.service static
ifupdown-wait-online.service disabled
iio-sensor-proxy.service static
initrd-cleanup.service static
initrd-parse-etc.service static
initrd-switch-root.service static
initrd-udevadm-cleanup-db.service static
keyboard-setup.service enabled
kmod-static-nodes.service static
kmod.service static
lm-sensors.service enabled
logrotate.service static
man-db.service static
ModemManager.service enabled
network-manager.service enabled
networking.service enabled
NetworkManager-dispatcher.service enabled
NetworkManager-wait-online.service enabled
NetworkManager.service enabled
nvidia-persistenced.service enabled
packagekit-offline-update.service static
packagekit.service static
plymouth-halt.service static
plymouth-kexec.service static
plymouth-log.service static
plymouth-poweroff.service static
plymouth-quit-wait.service static
plymouth-quit.service static
plymouth-read-write.service static
plymouth-reboot.service static
plymouth-start.service static
plymouth-switch-root.service static
plymouth.service static
polkit.service static
pppd-dns.service enabled
procps.service static
quotaon.service static
rc-local.service static
rc.service masked
rcS.service masked
rescue.service static
rsyslog.service enabled
rtkit-daemon.service disabled
saned.service masked
saned@.service indirect
sddm.service indirect
serial-getty@.service disabled
snapd.seeded.service enabled
snapd.service enabled
sudo.service masked
syslog.service enabled
system-update-cleanup.service static
systemd-ask-password-console.service static
systemd-ask-password-plymouth.service static
systemd-ask-password-wall.service static
systemd-backlight@.service static
systemd-binfmt.service static
systemd-bless-boot.service static
systemd-boot-check-no-failures.service disabled
systemd-boot-system-token.service static
systemd-cryptsetup@chome.service generated
systemd-exit.service static
systemd-fsck-root.service enabled-runtime
systemd-fsck@.service static
systemd-fsckd.service static
systemd-halt.service static
systemd-hibernate-resume@.service static
systemd-hibernate.service static
systemd-hostnamed.service static
systemd-hwdb-update.service static
systemd-hybrid-sleep.service static
systemd-initctl.service static
systemd-journal-flush.service static
systemd-journald.service static
systemd-kexec.service static
systemd-localed.service static
systemd-logind.service static
systemd-machine-id-commit.service static
systemd-modules-load.service static
systemd-network-generator.service disabled
systemd-networkd-wait-online.service disabled
systemd-networkd.service disabled
systemd-poweroff.service static
systemd-pstore.service disabled
systemd-quotacheck.service static
systemd-random-seed.service static
systemd-reboot.service static
systemd-remount-fs.service enabled-runtime
systemd-resolved.service disabled
systemd-rfkill.service static
systemd-suspend-then-hibernate.service static
systemd-suspend.service static
systemd-sysctl.service static
systemd-sysusers.service static
systemd-time-wait-sync.service disabled
systemd-timedated.service static
systemd-timesyncd.service enabled
systemd-tmpfiles-clean.service static
systemd-tmpfiles-setup-dev.service static
systemd-tmpfiles-setup.service static
systemd-udev-settle.service static
systemd-udev-trigger.service static
systemd-udevd.service static
systemd-update-utmp-runlevel.service static
systemd-update-utmp.service static
systemd-user-sessions.service static
systemd-volatile-root.service static
udev.service static
udisks2.service enabled
ufw.service enabled
unattended-upgrades.service enabled
upower.service disabled
usb_modeswitch@.service static
usbmuxd.service static
user-runtime-dir@.service static
user@.service static
vboxweb.service enabled
virtualbox.service generated
wacom-inputattach@.service static
wpa_supplicant-nl80211@.service disabled
wpa_supplicant-wired@.service disabled
wpa_supplicant.service enabled
wpa_supplicant@.service disabled
x11-common.service masked

173 unit files listed.


Com a lista completa você tem o nome correto do serviço e pode verificar o estado dele e com isso identificar possíveis problemas.

Confira o estado de um determinado serviço com o exemplo abaixo, altere o serviço para um da sua realidade.

systemctl status console-getty.service




Um bom exemplo de serviço com problema é o dessa matéria, nele ocorre uma falha na instalação do Samba deixando o serviço Masked.





Nesse exemplo basta desmarcar o serviço como Masked para Unmask e o ativar.

systemctl unmask samba-ad-dc.service

Ativar se aplica também aos serviços marcados como Disabled, lembre disso.

systemctl enable samba-ad-dc.service

Caso queira desativar algum serviço confira a matéria abaixo.

Deixar a inicialização mais rápida, Debian e Ubuntu


Para compreender melhor o básico do systemd recomendo a matéria abaixo.

Conhecendo o systemd by Fernando Debian


Comentários

Você precisa ver isso

Todos os arquivos do blog

Mostrar mais