Re:Systemd Wants to Expand to Include a Sudo Replacement
by iforgotpassword on Tuesday April 30, 2024 @03:41PM
(#40215373)
Huh, isn't grepping journalctl output pretty much the same? It even prefixes messages by the binary name.
[ Parent
| on HN ]
Re:Systemd Wants to Expand to Include a Sudo Replacement
by mdaniel on Tuesday April 30, 2024 @04:22PM
(#40215828)
Pedantically, they're the unit name which only sometimes matches the binary name
Re:Systemd Wants to Expand to Include a Sudo Replacement
by rezonant on Tuesday April 30, 2024 @06:12PM
(#40217066)
Actually no, they are prefixed by the binary name and the PID number. Technically they are prefixed with: `<date> <host> <binary>[<pid>]`.
You can then use `systemctl status <pid>` to identify the unit if you need to.
I would imagine this is configurable, and this might be the configuration chosen by my distribution (since I have not changed it myself). It would actually be nice to show the unit name instead of the binary/PID combination, though not strictly necessary.
EDIT: Ooh, systemd 239 adds `journalctl -o with-unit` to do this exact thing. There are lots of other formats you can choose from as well.
EDIT 2: Unfortunately there's no way to set this as default, you must use `-o with-unit` each time or set up a shell alias :-\