如果我将journalctl作为nonroot运行,我会收到以下消息:
No journal files were found.
但切换到root,或使用sudo给了我日记.
我通过将我的用户添加到systemd-journal组来实现(在centOS 7上):
原文链接:https://www.f2er.com/centos/373874.htmlsudo usermod -a -G systemd-journal bob
id -a bob uid=1000(bob) gid=1000(bob) groups=1000(bob),190(systemd-journal)
现在它的工作原理:
$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
我找到了这个:
http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
还有这个: