Stackexchange Answers: Systemd and PIDs

Systemd tracks PIDs. This is kind of obvious but I never thought to investigate before today. These two commands have been and I suspect, will be, very useful:

journalctl _PID = 1234

Get info on anything logged by the process in question. Technically, I suppose (?) it shouldn’t tell you anything that systemctl -u whatever.service doesn’t but it helped me get the exact error that caused the service not to work. Thanks, Rahul Khimasia.

systemctl status 1234

How exactly does pulseaudio get started on your desktop? Simply use htop to find the PID and ask systemctl for a status on the it and you will get told what systemd unit is associated with it. session-27.scope, it seems. Didn’t even know there was such a thing as ‘scopes’. Thanks, larsks.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.