NOTA: Isso mostra como você pode ajustar o nível de log do systemd e obter mais detalhes sobre os nomes dos serviços.
Para determinar o nível de log do systemd, você pode usar este comando:
$ systemctl -pLogLevel show
LogLevel=debug
Você pode alterá-lo assim:
$ systemd-analyze set-log-level notice
$ systemctl -pLogLevel show
LogLevel=notice
Os vários níveis são os seguintes:
--log-level=
Set log level. As argument this accepts a numerical log level or the
well-known syslog(3) symbolic names (lowercase): emerg, alert, crit,
err, warning, notice, info, debug.
Para torná-lo permanente entre as reinicializações, você pode editá-lo no arquivo de configuração do systemd:
$ grep LogLevel /etc/systemd/system.conf
#LogLevel=info
Ou defina a definição do arquivo /etc/default/grub
para GRUB_CMDLINE_LINUX
e GRUB_CMDLINE_LINUX_DEFAULT
.
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 net.ifnames=0 quiet loglevel=5 rd.systemd.show_status=auto systemd.log_level=debug"
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0,115200n8 earlyprintk=ttyS0,115200 rootdelay=300 net.ifnames=0 quiet loglevel=5 rd.systemd.show_status=auto systemd.log_level=debug"
Em seguida, recrie seu initramfs:
$ grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-693.21.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-693.21.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-1ec1e304541e429e8876ba9b8942a14a
Found initrd image: /boot/initramfs-0-rescue-1ec1e304541e429e8876ba9b8942a14a.img
done
Quando o nível é definido como debug
, as mensagens do systemd são assim:
$ journalctl -b | less
Jul 13 12:06:44 centos7 systemd[1]: Activating default unit: default.target
Jul 13 12:06:44 centos7 systemd[1]: Trying to enqueue job initrd.target/start/isolate
Jul 13 12:06:44 centos7 systemd[1]: Installed new job local-fs.target/start as 20
Jul 13 12:06:44 centos7 systemd[1]: Installed new job systemd-udev-trigger.service/start as 18
Jul 13 12:06:44 centos7 systemd[1]: Installed new job systemd-udevd-control.socket/start as 8
Jul 13 12:06:44 centos7 systemd[1]: Installed new job remote-fs.target/start as 38
Jul 13 12:06:44 centos7 systemd[1]: Installed new job sysroot.mount/start as 31
Jul 13 12:06:44 centos7 systemd[1]: Installed new job swap.target/start as 17
Jul 13 12:06:44 centos7 systemd[1]: Installed new job kmod-static-nodes.service/start as 21
Jul 13 12:06:44 centos7 systemd[1]: Installed new job slices.target/start as 26
Jul 13 12:06:44 centos7 systemd[1]: Installed new job systemd-journald.service/start as 9
Jul 13 12:06:44 centos7 systemd[1]: Installed new job initrd-root-fs.target/start as 30
Jul 13 12:06:44 centos7 systemd[1]: Installed new job systemd-tmpfiles-setup-dev.service/start as 19
Jul 13 12:06:44 centos7 systemd[1]: Installed new job paths.target/start as 27
Jul 13 12:06:44 centos7 systemd[1]: Installed new job initrd.target/start as 1
Jul 13 12:06:44 centos7 systemd[1]: Installed new job initrd-fs.target/start as 42
...
...
Jul 13 12:06:44 centos7 systemd[1]: dracut-pre-udev.service: cgroup is empty
Jul 13 12:06:44 centos7 systemd[1]: ConditionPathIsReadWrite=/sys succeeded for systemd-udevd.service.
Jul 13 12:06:44 centos7 systemd[1]: About to execute: /usr/lib/systemd/systemd-udevd
Jul 13 12:06:44 centos7 systemd[1]: Forked /usr/lib/systemd/systemd-udevd as 226
Jul 13 12:06:44 centos7 systemd[1]: systemd-udevd.service changed dead -> start
Jul 13 12:06:44 centos7 systemd[1]: Starting udev Kernel Device Manager...
Jul 13 12:06:44 centos7 systemd[1]: Got cgroup empty notification for: /system.slice/dracut-pre-udev.service
Jul 13 12:06:44 centos7 systemd[1]: dracut-pre-udev.service: cgroup is empty
Jul 13 12:06:44 centos7 systemd[226]: Executing: /usr/lib/systemd/systemd-udevd
Jul 13 12:06:44 centos7 systemd-udevd[226]: ctrl=4 netlink=3
Você pode ver claramente os nomes dos serviços na saída acima, por exemplo. systemd-journald.service
.