[systemd-devel] right way to log to rsyslog/syslog only?

Leonid Isaev lisaev at umail.iu.edu
Thu Aug 7 08:52:42 PDT 2014


On Thu, Aug 07, 2014 at 02:06:07PM +0200, Frantisek Hanzlik wrote:
> '/etc/systemd/system.conf':
> [Manager]
> LogTarget=syslog-or-kmsg
> DefaultStandardOutput=syslog

Leave 'LogTarget=' to its default value (journal-or-kmsg).

> It's good that I have no /var/log/journal/* files, but
> - journald is still runnig (this isn't too imporatant, but when it
>    is possible work without it, it will be better)
> - fundamental problem seems be, that some daemons logs not appear
>    in rsyslog files, for unknown reason.

Could you be more specific about which daemons are affected?

Many daemons that are started by systemd service run in foreground (don't ask
me about the logic behind this). This means that all output is sent to stdout,
not syslog. Journald collects this output and forwards it to syslog -- hence my
recommendation above.

For example, sshd(8) now runs with '-D'. Of course, some daemons might send
their messages syslog even if run in foreground, but not all.

A hard way to fix this is to modify service files for daemons you use to run in
background and set 'Type=forking'.

Leonid Isaev
GPG fingerprints: DA92 034D B4A8 EC51 7EA6  20DF 9291 EE8A 043C B8C4
                  C0DF 20D0 C075 C3F1 E1BE  775A A7AE F6CB 164B 5A6D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140807/772adf66/attachment.sig>

More information about the systemd-devel mailing list