3

I enable non quiet boot, and I wonder how I can simply manage to have real name of services started instead of things like :

[Started] Manage, install and generate color profile

I really hate when things are hidden from me specially on linux, how could it just shows :

[Started] service colord

Obviously this one is just an example, I'd like to simply print the service name started instead of its description without activating ultra hard verbose debug info (if possible).

Kiwy
  • 9,534

1 Answers1

1

NOTE: This shows how you can adjust systemd's loglevel and get more details about the service names.


To determine systemd's loglevel you can use this command:

$ systemctl -pLogLevel show
LogLevel=debug

You can change it like this:

$ systemd-analyze set-log-level notice

$ systemctl -pLogLevel show
LogLevel=notice

The various levels are as follows:

   --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.

To make it permanent between reboots you can either edit it in systemd's config file:

$ grep LogLevel /etc/systemd/system.conf
#LogLevel=info

Or set it via /etc/default/grub file's definition for GRUB_CMDLINE_LINUX and 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"

Then rebuild your 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

When the level is set to debug, the messages from systemd look like this:

$ 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

You can clearly see the names of the services in the above output, for eg. systemd-journald.service.

References

slm
  • 369,824
  • 1
    I'll test that probably this weekend or monday, I'll keep in touch . – Kiwy Jul 13 '18 at 23:32
  • @Kiwy - sure thing, good luck. – slm Jul 13 '18 at 23:34
  • after further testing it's not exactly what I want, and enableling debug is nothing reasonable on my laptop, but it's interesting. I guess systemd is once again disappointing me but I was expecting that... – Kiwy Jul 17 '18 at 06:33
  • @Kiwy sad to hear that. I like it so much more that sysv or upstart. It does so much right. – slm Jul 17 '18 at 11:17
  • @Kiwy what did you want to do with you Q? You want more leads? – slm Jul 17 '18 at 11:18
  • I think this is as close as it can get, but I can't run systemd on debug mode forever. It will generate too much log and with my current experiment it didn't change boot output only the logs. Regarding systemd I've already encounter so many compatibility issue and small very annoying bug, but it's easy because it almost an OS in itself now. It's like I never find it more useful than a regular sysV – Kiwy Jul 17 '18 at 13:34