0

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?

4
  • 1
    Interesting...on my Ubuntu 22.04 system, this does not happen. Is there an alias for journalctl floating around? Can't imagine what would have changed from 20.04 to 22.04. Sep 11, 2023 at 17:53
  • Does systemctl status service_name do the same thing? Sep 11, 2023 at 22:05
  • @PabloA that’s an important piece of information no one could have guessed, would you mind adding it to your question? Does /bin/journalctl work properly? Sep 12, 2023 at 4:28
  • @ajgringo619 I moved the info to the question.
    – Pablo A
    Sep 12, 2023 at 5:18

0

You must log in to answer this question.

Browse other questions tagged .