Re: Logs from a service is not showing up in journalctl but showing up in syslog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Do, 25.07.19 15:55, Debraj Manna (subharaj.manna@xxxxxxxxx) wrote:

> I have unit file which looks like below. I am seeing some of the echo are
> showing up in syslog but not in journalctl. Can someone let me know what is
> going on?
> systemd version 229 running on Ubuntu 16.
>
> ExecStartPre=-/bin/su ubuntu -c
> "/home/ubuntu/build-target/kafka/kafka-systemd-prestart.sh"
> ExecStart=/bin/su ubuntu -c
> "/home/ubuntu/build-target/kafka/kafka-systemd-health.sh"

If you use "su" this creates a new login session (and thus a scope
unit) for your program, and thus any processes/logs will be associated
with that login session scope unit, and not with the service unit you
are writing here.

Use "User=" to run services under specific user identities. Or at
least use "setpriv" rather than "su" since the former just changes
privs, but doesn't actually acquire a PAM session and everything.

Lennart

--
Lennart Poettering, Berlin
_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux