TransWikia.com

How can systemctl display username and log file path in systemctl status?

Ask Ubuntu Asked by Ciasto piekarz on December 5, 2021

When I run

systemctl status <service name>

how can I also see by what user it is running and the path of the log file?

One Answer

How to find the UID, PID and Log Target of an service (unit)

You can print the UID (user identity), ExecPID and StandardOutput (log-target) by running this command

systemctl show -p ExecMainPID,UID,StandardOutput <Name-of-your-Service>

In this example these parameters are printed for the NetworkManager service:

$ systemctl show -p ExecMainPID,UID,StandardOutput NetworkManager
UID=[not set]
ExecMainPID=1122
StandardOutput=journal

UID=[not set] is equivalent to root.

The journal path by default is found for

  • persistent storage: /var/log/journal/<machine-id>/system.journal

  • volatile storage: /run/systemd/journal/<machine-id>.

Answered by abu_bua on December 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP