[systemd-devel] logger --id=val is ignored by systemd

Lennart Poettering lennart at poettering.net
Wed Oct 21 02:25:25 PDT 2015


On Wed, 21.10.15 10:05, Olaf Hering (olaf at aepfle.de) wrote:

> How can scripts which use "logger -t id --id=val" get "me[val]" into syslog?
> This used to work, with a systemd based system it looks like this:
> 
> root at probook:~ # journalctl -f &
> root at probook:~ # logger -t "me" --no-act --stderr  --id=$PPID "foo: blah"
> <13>Oct 21 09:58:11 me[2606]: foo: blah
> root at probook:~ # logger -t "me" --no-act --stderr  --id=$PPID "foo: blah"
> <13>Oct 21 09:58:13 me[2606]: foo: blah
> root at probook:~ # logger -t "me" --id=$PPID "foo: blah"
> root at probook:~ # Oct 21 10:02:33 probook.fritz.box me[2928]: foo: blah
> logger -t "me" --id=$PPID "foo: blah"
> root at probook:~ # Oct 21 10:02:34 probook.fritz.box me[2929]: foo: blah
> 
> 
> I expect "me[2606]" to appear in "journalctl -f" output, but appearently the id
> is always replaced by the pid of logger.
> How should a script look like to comply with systemd?

We do not allow faking syslog PID fields, for security reasons, it
will always be set to what the kernel passed to journald.

If this is something to support, then "logger" needs to to be patched
so that it can fake the SCM_CREDENTIALS metadata of the messages sent. This
requires privileges, but is not hard to do. Please file a bug against
util-linux and ask for for this to be added.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list