]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/journal/journalctl.c
journalctl: improve hint about lack of access for --user-unit=...
authorZbigniew JÄ\99drzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 19 Feb 2018 21:40:26 +0000 (22:40 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Feb 2018 21:36:01 +0000 (22:36 +0100)
commite79d0b59c8d01d35343b21d02d997d2579c32f27
tree2999a5c8332215ae77c1b08c48e32b800c690f70
parent2e10cc5649193eef5117fa5186869fbb74b0481e
journalctl: improve hint about lack of access for --user-unit=...

When running journalctl --user-unit=foo as an unprivileged user we could get
the usual hint:
Hint: You are currently not seeing messages from the system and other users.
      Users in groups 'adm', 'systemd-journal', 'wheel' can see all messages.
      ...
But with --user-unit our filter is:
(((_UID=0 OR _UID=1000) AND OBJECT_SYSTEMD_USER_UNIT=foo.service) OR
 ((_UID=0 OR _UID=1000) AND COREDUMP_USER_UNIT=foo.service) OR
 (_UID=1000 AND USER_UNIT=foo.service) OR
 (_UID=1000 AND _SYSTEMD_USER_UNIT=foo.service))
so we would never see messages from other users.

We could still see messages from the system. In fact, on my machine the
only messages with OBJECT_SYSTEMD_USER_UNIT= are from the system:
journalctl  $(journalctl -F OBJECT_SYSTEMD_USER_UNIT|sed 's/.*/OBJECT_SYSTEMD_USER_UNIT=\0/')

Thus, a more correct hint is that we cannot see messages from the system.
Make it so.

Fixes #7887.
src/coredump/coredumpctl.c
src/journal/journalctl.c
src/shared/journal-util.c
src/shared/journal-util.h