19

I am running user-level services in Ubuntu 16.04 LTS. For example, I have my test.service located at ~/.config/systemd/user/test.service

I was able to run the service by doing

systemctl --user start test.target

However, when I try to read its log using journalctl, I got this error message:

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.

How can I use journalctl for user's specific unit?

16

On older systemd versions, you'll have to use journalctl --user --user-unit=SERVICENAME (on newer versions journalctl --user -u SERVICENAME will work fine).

However, this only works if the Storage directive of the [Journal] section of /etc/systemd/journald.conf is set to persistent (instead of auto or volatile). Reboot after editing the configuration file and the user will be able to see the journal.

More information: https://www.freedesktop.org/software/systemd/man/journald.conf.html https://lists.freedesktop.org/archives/systemd-devel/2016-October/037554.html

| improve this answer | |
  • 1
    Adding the user to the systemd-journal group was the answer I needed (from that mailing list link). – Travis Well Jun 30 '17 at 21:41
  • This worked for me on Ubuntu 17.10, where one user inexplicably couldn't view his logs, while another could. – elBradford Dec 21 '17 at 18:04
  • 2
    Adding a user to the systemd-journal group would be a workaround, but since my service was a user service, I don't think the logs were generated in the first place, so allowing my user to view all the other logs wouldn't have helped anyway. – elBradford Dec 21 '17 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.