小编Chr*_*rts的帖子

如何允许用户使用 journalctl 查看用户特定的 systemd 服务日志?

我在 Ubuntu 16.04 LTS 中运行用户级服务。例如,我的 test.service 位于~/.config/systemd/user/test.service.

我能够通过这样做来运行服务

systemctl --user start test.target
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试使用 读取其日志时journalctl,收到以下错误消息:

journalctl --user -u test.service
Hint: You are currently not seeing messages from other users and the system.
  Users in the 'systemd-journal' group can see all messages. Pass -q to
  turn off this notice.
No journal files were opened due to insufficient permissions.
Run Code Online (Sandbox Code Playgroud)

如何journalctl用于用户的特定单位?

permissions systemd systemctl journalctl ubuntu-16.04

32
推荐指数
1
解决办法
2万
查看次数