基于系统文本的控制台年表

问题描述 投票:-1回答:1

系统启动过程非常复杂,因此按时间顺序列出启动的服务将很有用。

为此,可以创建一个svg文件:

systemd-analyze plot > startup_order.svg

分析服务器上的systemd行为时,获得基于konsole的版本将很有用。有人知道该怎么做吗?

我最近来的是

for i in $(systemctl --no-pager --no-legend --all -o short-precise | cut -f 1 -d " "); do printf "%s %s\n" "$(systemctl show $i -p ExecMainStartTimestampMonotonic 2>/dev/null)" "$i";done | sed -n '/=/p' | sed 's/^ExecMainStartTimestampMonotonic=//' | sort -n

但是,我认为ExecMainStartTimestampMonotonic不是启动开始时间。

有什么想法吗?

systemd
1个回答
0
投票

systemd-analyze plot的输出是一个SVG,它只是文本(XML)。您可以使用sed进行解析以获取所需的内容。

© www.soinside.com 2019 - 2024. All rights reserved.