6

Is there a command to list systemd services that run on startup in the order in which they run? I'm using 18.04

Raffa
  • 32,237
John
  • 73
  • Maybe this will give you the answer to what you're looking for. – Tsafaras Jan 04 '20 at 23:55
  • By "services" do you specifically mean systemd services? Or something else? Are you simply curious? Or is there some issue that you believe such a list will help you investigate or solve? – user535733 Jan 05 '20 at 00:01
  • @user535733 I do mean systemd services, my apologies. If have a unit file I need running after everything else runs, so once I know what the last thing is I can set said unit file to "after=lastservice.service". Can you help me with this? – John Jan 05 '20 at 00:16
  • Why does it need to run "after everything else?" For example, anacron runs a few minutes after everything else. Should your job run after anacron? apt.daily runs some random time up to an hour after startup. Should your job run after apt.daily? – user535733 Jan 05 '20 at 00:17
  • @user535733 bear with me, I just started using LInux 4 days ago. I need it to run specifically after all of my audio/microphone services run. I am unable to pinpoint exactly which audio/microphone services at the time of writing this comment, so I am just making it run after everything. I was unaware of anacron/apt.daily. You're knowledgeable it seems, what do you recommend I run it after? – John Jan 05 '20 at 00:24
  • Advice: Try having your job depend upon systemd's default.target. That's among the last targets after startup on a desktop system, and should be a very long time after hardware/audio is up (audio.target). Try to be patient when volunteers are trying to help you. – user535733 Jan 05 '20 at 00:52

1 Answers1

6

Yes,

Run in the terminal:

systemd-analyze dump > ~/SystemdAnalyzeDump.txt

and to view it, run in the terminal:

gedit ~/SystemdAnalyzeDump.txt

or if you prefer a graphical representation, run in the terminal:

systemd-analyze plot > ~/SystemdAnalyzePlot.svg

and to view it, run in the terminal:

eog ~/SystemdAnalyzePlot.svg

Notice that the --user option can be used with the above commands like systemd-analyze --user dump ... and systemd-analyze --user plot ... to show user units instead.

Raffa
  • 32,237
  • On 18.04 it (GNOME Image Viewer 3.28.1) it seems we have this fixed bug on librsvg. Not sure since which version is fixed. – Pablo Bianchi Feb 20 '21 at 02:30
  • 1
    I wish I could upvote this multiple times, it's so useful! One remark, I found that parts of the svg graph may get drawn outside the "canvas", and EOG (Eye Of the Gnome, aka image viewer app) will not show these parts outside of the page area. Viewing it with an SVG editor app, like Inkscape, however shows all the parts even those outside of the page area. – Levente Feb 26 '21 at 16:51