20

If I run journalctl as nonroot, I would get the following message:

No journal files were found.

But switching to root, or using sudo gives me the journal.

How can I view journals without switching to root (e.g. which group should I add myself in)? Cannot find it in the documents.

xuhdev
  • 890
  • 2
  • 8
  • 20

1 Answers1

29

I got that to work (on centOS 7) by adding my user to the systemd-journal group:

sudo usermod -a -G systemd-journal bob

bob is now a member, log out, log in and:

id -a bob
uid=1000(bob) gid=1000(bob) groups=1000(bob),190(systemd-journal)

And now it works:

$ journalctl
-- Logs begin at Mon 2015-04-06 09:50:36 BST, end at Thu 2015-04-09 20:20:16 BST. --
Apr 06 09:50:36 localhost.localdomain chronyd[941]: Can't synchronise: no majority
Apr 06 09:50:36 localhost.localdomain chronyd[941]: Selected source 91.206.8.70
Apr 06 09:51:07 localhost.localdomain systemd[1]: Time has been changed

I found this:

http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html

and this:

http://0pointer.de/blog/projects/journalctl.html

gm3dmo
  • 10,057
  • 1
  • 42
  • 36
  • 1
    Great, I found adm group also works as shown [here](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/s1-Using_the_Journal.html) – xuhdev Apr 09 '15 at 19:40
  • 1
    adm and systemd-journal don't work for me. I've verified that I'm a member of both, but still no journalctl (unless I run with sudo) – Mark Lakata Jun 02 '15 at 21:06
  • Mark, what is your operating system and version? – gm3dmo Jun 03 '15 at 05:07
  • 2
    I've got the same thing as @MarkLakata now on a fresh Debian 8 (jessie) system. Tried groups adm, sudo, and systemd-journal, and exit/login to refresh groups but still need "sudo journalctl". – Peter Hansen Feb 22 '16 at 03:39
  • Did you find a solution? – Rogier Lommers Aug 05 '17 at 10:03
  • 3
    Don't forget to logout and in again. Starting a new terminal isn't enough. – Stewart Apr 02 '19 at 12:54