命令 systemd-analyze key-chain 用红色突出显示一些条目,该颜色表示什么?

命令 systemd-analyze key-chain 用红色突出显示一些条目,该颜色表示什么?

systemd-analyze关键链的输出:

multi-user.target @30.366s
 └─docker.service @5.230s +851ms
  └─network-online.target @5.227s
   └─network.target @5.222s
    └─network.service @4.872s +349ms
     └─NetworkManager-wait-online.service @1.438s +3.431s
      └─NetworkManager.service @1.402s +35ms
       └─netcf-transaction.service @1.320s +56ms
        └─basic.target @1.285s
         └─sockets.target @1.285s
          └─virtlockd.socket @1.285s
           └─sysinit.target @1.279s
            └─systemd-update-utmp.service @1.262s +16ms
             └─auditd.service @1.120s +140ms
              └─systemd-tmpfiles-setup.service @1.071s +44ms
               └─rhel-import-state.service @1.016s +52ms
                └─local-fs.target @1.011s
                 └─var-lib-docker-plugins.mount @5.788s
                  └─dev-mapper-vg1\x2droot.device @372ms +260ms

将某些条目涂成红色;在这种情况下,它们是:

docker.service @5.230s +851ms
network.service @4.872s +349ms
NetworkManager-wait-online.service @1.438s +3.431s
NetworkManager.service @1.402s +35ms
netcf-transaction.service @1.320s +56ms
systemd-update-utmp.service @1.262s +16ms
auditd.service @1.120s +140ms
systemd-tmpfiles-setup.service @1.071s +44ms
rhel-import-state.service @1.016s +52ms
dev-mapper-vg1\x2droot.device @372ms +260ms

颜色代表什么?

答案1

红色仅突出显示+?ms在 后具有值的条目@...。根据systemd-analyze手册页:

   systemd-analyze critical-chain [UNIT...]  prints a tree of the
   time-critical chain of units (for each of the specified UNITs or for the
   default target otherwise). The time after the unit is active or started
   is printed after the "@" character. The time the unit takes to start is
   printed after the "+" character. Note that the output might be misleading
   as the initialization of one service might depend on socket activation
   and because of the parallel execution of units.

因此,它只是突出显示实际上需要时间才能启动的单元,例如真正的服务(Docker,...),而不是刚刚满足但不“启动”的简单目标。

相关内容