sonic-buildimage
sonic-buildimage copied to clipboard
[docker] After modifying system time, "docker ps" shows status is " Up Less than a second"
Description
After modifying system time to earlier , "docker ps" shows status is " Up Less than a second".
Steps to reproduce the issue:
root@switch2:/home/admin# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
063a61038a21 docker-snmp-sv2:latest "/usr/bin/supervisord" 22 hours ago Up 7 minutes snmp
67babe9947db docker-sonic-telemetry:latest "/usr/bin/supervisord" 22 hours ago Up 7 minutes telemetry
fbd4f23eaacc docker-sflow:latest "/usr/bin/supervisord" 22 hours ago Up 5 hours sflow
70edb6669d12 docker-router-advertiser:latest "/usr/bin/supervisord" 22 hours ago Up 5 hours radv
e11bda44ca4d docker-dhcp-relay:latest "/usr/bin/docker_ini…" 22 hours ago Up 5 hours dhcp_relay
ae910a3d734e docker-lldp-sv2:latest "/usr/bin/supervisord" 22 hours ago Up 5 hours lldp
edd8857b2e74 docker-nat:latest "/usr/bin/supervisord" 22 hours ago Up 5 hours nat
5351b03fb37d docker-syncd-brcm:latest "/usr/bin/supervisord" 22 hours ago Up 5 hours syncd
ccb44ddb8430 docker-teamd:latest "/usr/bin/supervisord" 22 hours ago Up 5 hours teamd
23e7eef62f26 docker-sonic-mgmt-framework:latest "/usr/bin/supervisord" 22 hours ago Up 5 hours mgmt-framework
e3c6b08d19a5 docker-orchagent:latest "/usr/bin/supervisord" 22 hours ago Up 5 hours swss
394bc7a97869 docker-platform-monitor:latest "/usr/bin/docker_ini…" 22 hours ago Up 5 hours pmon
844049dd8abe docker-fpm-frr:latest "/usr/bin/supervisord" 22 hours ago Up 5 hours bgp
54c52f9ced77 docker-database:latest "/usr/local/bin/dock…" 22 hours ago Up 5 hours database
root@switch2:/home/admin# date
Thu May 7 14:40:28 CST 2020
root@switch2:/home/admin# date -s 08:00:00
Thu May 7 08:00:00 CST 2020
root@switch2:/home/admin# hwclock -w
root@switch2:/home/admin# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
063a61038a21 docker-snmp-sv2:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second snmp
67babe9947db docker-sonic-telemetry:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second telemetry
fbd4f23eaacc docker-sflow:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second sflow
70edb6669d12 docker-router-advertiser:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second radv
e11bda44ca4d docker-dhcp-relay:latest "/usr/bin/docker_ini…" 15 hours ago Up Less than a second dhcp_relay
ae910a3d734e docker-lldp-sv2:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second lldp
edd8857b2e74 docker-nat:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second nat
5351b03fb37d docker-syncd-brcm:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second syncd
ccb44ddb8430 docker-teamd:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second teamd
23e7eef62f26 docker-sonic-mgmt-framework:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second mgmt-framework
e3c6b08d19a5 docker-orchagent:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second swss
394bc7a97869 docker-platform-monitor:latest "/usr/bin/docker_ini…" 15 hours ago Up Less than a second pmon
844049dd8abe docker-fpm-frr:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second bgp
54c52f9ced77 docker-database:latest "/usr/local/bin/dock…" 15 hours ago Up Less than a second database
root@switch2:/home/admin# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
063a61038a21 docker-snmp-sv2:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second snmp
67babe9947db docker-sonic-telemetry:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second telemetry
fbd4f23eaacc docker-sflow:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second sflow
70edb6669d12 docker-router-advertiser:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second radv
e11bda44ca4d docker-dhcp-relay:latest "/usr/bin/docker_ini…" 15 hours ago Up Less than a second dhcp_relay
ae910a3d734e docker-lldp-sv2:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second lldp
edd8857b2e74 docker-nat:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second nat
5351b03fb37d docker-syncd-brcm:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second syncd
ccb44ddb8430 docker-teamd:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second teamd
23e7eef62f26 docker-sonic-mgmt-framework:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second mgmt-framework
e3c6b08d19a5 docker-orchagent:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second swss
394bc7a97869 docker-platform-monitor:latest "/usr/bin/docker_ini…" 15 hours ago Up Less than a second pmon
844049dd8abe docker-fpm-frr:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second bgp
54c52f9ced77 docker-database:latest "/usr/local/bin/dock…" 15 hours ago Up Less than a second database
root@switch2:/home/admin# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
063a61038a21 docker-snmp-sv2:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second snmp
67babe9947db docker-sonic-telemetry:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second telemetry
fbd4f23eaacc docker-sflow:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second sflow
70edb6669d12 docker-router-advertiser:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second radv
e11bda44ca4d docker-dhcp-relay:latest "/usr/bin/docker_ini…" 15 hours ago Up Less than a second dhcp_relay
ae910a3d734e docker-lldp-sv2:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second lldp
edd8857b2e74 docker-nat:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second nat
5351b03fb37d docker-syncd-brcm:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second syncd
ccb44ddb8430 docker-teamd:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second teamd
23e7eef62f26 docker-sonic-mgmt-framework:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second mgmt-framework
e3c6b08d19a5 docker-orchagent:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second swss
394bc7a97869 docker-platform-monitor:latest "/usr/bin/docker_ini…" 15 hours ago Up Less than a second pmon
844049dd8abe docker-fpm-frr:latest "/usr/bin/supervisord" 15 hours ago Up Less than a second bgp
54c52f9ced77 docker-database:latest "/usr/local/bin/dock…" 15 hours ago Up Less than a second database
root@switch2:/home/admin#
This is an issue of docker and exists in other linux system.
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
**Output of `show version`:**
```
admin@switch2:~$ show ver
SONiC Software Version: SONiC.201911_rj.0-dirty-20200427.104430
Distribution: Debian 9.12
Kernel: 4.9.0-9-2-amd64
Build commit: 03e82943
Build date: Mon Apr 27 11:24:37 CST 2020
Built by: ngcf@ubuntu01
Platform: x86_64-ruijie_b6510-48vs8cq-r0
HwSKU: B6510-48VS8CQ
ASIC: broadcom
Serial Number: G1MW80H000123
Uptime: 17:05:25 up 6:17, 2 users, load average: 0.24, 0.48, 0.45
Docker images:
REPOSITORY TAG IMAGE ID SIZE
docker-sflow 201911_rj.0-dirty-20200427.104430 80a28cb79365 303MB
docker-sflow latest 80a28cb79365 303MB
docker-orchagent 201911_rj.0-dirty-20200427.104430 6031a24da708 320MB
docker-orchagent latest 6031a24da708 320MB
docker-fpm-frr 201911_rj.0-dirty-20200427.104430 09fc238a71b6 323MB
docker-fpm-frr latest 09fc238a71b6 323MB
docker-teamd 201911_rj.0-dirty-20200427.104430 47f2707b994e 303MB
docker-teamd latest 47f2707b994e 303MB
docker-nat 201911_rj.0-dirty-20200427.104430 3fa75edfeb2c 305MB
docker-nat latest 3fa75edfeb2c 305MB
docker-syncd-brcm 201911_rj.0-dirty-20200427.104430 c7455683f6b2 432MB
docker-syncd-brcm latest c7455683f6b2 432MB
docker-platform-monitor 201911_rj.0-dirty-20200427.104430 d2db761ec3db 330MB
docker-platform-monitor latest d2db761ec3db 330MB
docker-snmp-sv2 201911_rj.0-dirty-20200427.104430 d759521915ef 336MB
docker-snmp-sv2 latest d759521915ef 336MB
docker-lldp-sv2 201911_rj.0-dirty-20200427.104430 fa6a82bf3426 300MB
docker-lldp-sv2 latest fa6a82bf3426 300MB
docker-sonic-telemetry 201911_rj.0-dirty-20200427.104430 03706795bd57 340MB
docker-sonic-telemetry latest 03706795bd57 340MB
docker-router-advertiser 201911_rj.0-dirty-20200427.104430 c46b7613a554 279MB
docker-router-advertiser latest c46b7613a554 279MB
docker-sonic-mgmt-framework 201911_rj.0-dirty-20200427.104430 07ad1190b17e 395MB
docker-sonic-mgmt-framework latest 07ad1190b17e 395MB
docker-dhcp-relay 201911_rj.0-dirty-20200427.104430 79be1f26ecf0 289MB
docker-dhcp-relay latest 79be1f26ecf0 289MB
docker-database 201911_rj.0-dirty-20200427.104430 382753e8b673 279MB
docker-database latest 382753e8b673 279MB
```
**Attach debug file `sudo generate_dump`:**
```
(paste your output here)
```
you have changed the system time, what is the expectation here?
I think the time of docker should synchronize with system time, but in this case it didn't. Docker was up for 5 hours, and then changed the system time to more than 5 hours ago, the status showed up less than a second. The expectation is up 5 hours.
How do you change the time zone to CST