Sample Header Ad - 728x90

Why journalctl uses --utc by default when running without root privileges?

1 vote
1 answer
1446 views
On a host running Ubuntu 20.04 LTS I notice that, by default, journalctl (without root privileges) is the same as journalctl --utc, but with root privileges journalctl honors the time zone (as shown with timedatectl).
$ journalctl | tail -1 | tr -s ' ' | cut -d' ' -f 1-3
Sep 11 16:38:00

$ sudo journalctl | tail -1 | tr -s ' ' | cut -d' ' -f 1-3
Sep 11 13:38:13

$ timedatectl | grep "Time zone" | tr -s ' ' | cut -d' ' -f 5-6
(-03, -0300)
- I suspect Homebrew/linuxbrew is the culprit, even /home/linuxbrew/.linuxbrew/etc/systemd/journald.conf has all its line commented out, but:
$ which journalctl  # systemd 253 (253) from --version
    /home/linuxbrew/.linuxbrew/bin/journalctl
    $ sudo which journalctl  # systemd 245 (245.4-4ubuntu3.22) from --version
    /bin/journalctl
- There is no alias to journalctl What is the logic behind this behavior? How can I change that, so by default journalctl always use current system time zone?
Asked by Pablo A (3196 rep)
Sep 11, 2023, 04:41 PM
Last activity: Feb 5, 2025, 02:53 PM