[systemd-devel] Logs from a service is not showing up in journalctl but showing up in syslog
Lennart Poettering
lennart at poettering.net
Mon Jul 29 12:36:51 UTC 2019
On Do, 25.07.19 14:20, Mantas Mikulėnas (grawity at gmail.com) wrote:
> Take a look at `journalctl -o verbose SYSLOG_IDENTIFIER=su _PID=38464`.
>
> I suspect the messages *are* in the journal, just not tagged with
> UNIT=kafka.service anymore. In some distros, `su` is actually configured to
> call pam_systemd and set up a new systemd-logind session – when this
> happens, the process is moved out of kafka.service into a user session
> scope, and its syslog messages are grouped accordingly.
It shouldn't just be "some distros" btw, it hopefully should be
all. Everything else would be a bug.
> Consider replacing `su` with `runuser`, or indeed with systemd's [Service]
> User= option.
"runuser" creates a PAM session too. "setpriv" is the command to use.
(Yes don't ask me why we have all three of su, runuser and setpriv
being different but also the same...)
Lennart
--
Lennart Poettering, Berlin
More information about the systemd-devel
mailing list