System logging shows different timezones

Hi,

I have correct timezone set in the system, for example, if I type "~# date", it gives me my localtime which is in the timezone of GMT +11.

but If run "'logger test123", I can see the log entry:

root: test123

has time stamp in the GMT 0 zone. in fact, the following programs all show time stamps in GMT 0

  • hostapd
  • uhttpd
  • collectd
  • root
  • dropbear

and these programs show time in GMT +11 which is what I expected:

  • kernel
  • dnsmasq-dhcp

How do I correct this problem?

Powered by LuCI openwrt-19.07 branch (git-21.189.23240-7b931da) / OpenWrt 19.07.6 r11278-8055e38794

What is the output of the following commands? Use preformatted text (the </> button) for console output.
uci export system; ls -la /etc/TZ; tz=$(ls -la /etc/TZ | grep -o '[^ ]*$') ; ls -la $tz

2 Likes

Here it is:

root@GenericRouter:~# uci export system; ls -la /etc/TZ; tz=$(ls -la /etc/TZ | grep -o '[^ ]*$') ; ls -la $tz
package system

config system
        option ttylogin '0'
        option log_size '64'
        option urandom_seed '0'
        option hostname 'GenericRouter'
        option log_proto 'udp'
        option conloglevel '8'
        option cronloglevel '8'
        option timezone '<+11>-11'
        option zonename 'Pacific/Kosrae'

config timeserver 'ntp'
        list server '0.openwrt.pool.ntp.org'
        list server '1.openwrt.pool.ntp.org'
        list server '2.openwrt.pool.ntp.org'
        list server '3.openwrt.pool.ntp.org'

config led 'led_wlan'
        option name 'WLAN'
        option trigger 'phy1tpt'
        option sysfs 'tp-link:green:wlan2g'

config led 'led_wlan5g'
        option name 'WLAN5G'
        option trigger 'phy0tpt'
        option sysfs 'tp-link:green:wlan5g'

config led 'led_wan'
        option name 'WAN'
        option trigger 'switch0'
        option port_mask '0x02'
        option sysfs 'tp-link:green:wan'

config led 'led_lan1'
        option name 'LAN1'
        option trigger 'switch0'
        option port_mask '0x04'
        option sysfs 'tp-link:green:lan4'

config led 'led_lan2'
        option name 'LAN2'
        option trigger 'switch0'
        option port_mask '0x08'
        option sysfs 'tp-link:green:lan3'

config led 'led_lan3'
        option name 'LAN3'
        option trigger 'switch0'
        option port_mask '0x10'
        option sysfs 'tp-link:green:lan2'

config led 'led_lan4'
        option name 'LAN4'
        option trigger 'switch0'
        option port_mask '0x20'
        option sysfs 'tp-link:green:lan1'

config led 'led_usb'
        option name 'USB'
        option trigger 'usbdev'
        option interval '50'
        option dev '1-1'
        option sysfs 'tp-link:green:usb'

lrwxrwxrwx    1 root     root             7 Jan 20 00:10 /etc/TZ -> /tmp/TZ
-rw-r--r--    1 root     root             9 Jul 18 16:03 /tmp/TZ
root@GenericRouter:~# cat /etc/TZ
<+11>-11
1 Like

Install package zoneinfo-pacific
Select timezone to match the Kosrae and make sure that the link of /tmp/TZ points to /usr/share/zoneinfo/Pacific/Kosrae