Search code examples
systemd

systemd text based console chronology



Systemd startup process is quite complex, hence it would be useful to get a listing of started services in chronological order.

To this aim, one can create a svg-file:

systemd-analyze plot > startup_order.svg

When analyzing systemd behaviour on a server, it would be useful to get a konsole-based version of this. Does anybody know how to do this?

Closest I came was

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

But, I think ExecMainStartTimestampMonotonic is not the boot start time.

Any ideas?


Solution

  • The output of systemd-analyze plot is an SVG, which is just text (XML). You can parse it using sed to get what you want.