journald 文档说将用户添加到“systemd-journal”组或“adm”组允许用户访问系统范围的日志。
我正在运行最新的 CentOS 7,但我似乎无法以非 root 用户身份访问日志。
这是我的配置:
$ id
uid=1000(centos) gid=1000(centos) groups=1000(centos),4(adm),10(wheel),190(systemd-journal) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
$ cat /etc/systemd/journald.conf
[Journal]
Storage=persistent
$ journalctl
-- Logs begin at Sat 2015-08-29 16:35:52 UTC, end at Sat 2015-08-29 17:28:47 UTC. --
Aug 29 16:35:52 hostname ... <log continues>
Run Code Online (Sandbox Code Playgroud)
journalctl 输出中没有系统日志。这是我的权限配置:
$ ll -a /var/log/journal/f9afeb75a5a382dce8269887a67fbf58/
total 24592
drwxr-xr-x. 2 root root 4096 Aug 29 16:35 .
drwxr-xr-x. 3 root root 4096 Aug 29 17:28 ..
-rw-r-----. 1 root root 16777216 Aug 29 17:27 system.journal
-rw-r-----+ 1 …
Run Code Online (Sandbox Code Playgroud)