systemd: how do I view journals with journalctl without switching to root on CentOS 7?
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.
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