sonic-buildimage/platform
Kebo Liu a8376ef109
[202205][Mellanox] change the implementation of is_host() to fix a stuck issue on simx platform (#13101)
This PR is to backport #13100 to the 202205 branch since can not be cleanly cherry-picked.

Following code to judge whether a process is running inside a docker could get stuck on the simx platform

subprocess.Popen(["docker", "--version"],
                                stdout=subprocess.PIPE,
                                stderr=subprocess.STDOUT,
                                universal_newlines=True)
When it gets stuck, the config-chassisdb service can not be successfully started, thus the system can not be booted up.

root@sonic:/# service config-chassisdb status
     config-chassisdb.service - Config chassis_db
     Loaded: loaded (/lib/systemd/system/config-chassisdb.service; enabled; vendor preset: enabled)
     Active: activating (start) since Thu 2022-12-15 09:23:02 UTC; 29min ago
   Main PID: 571 (config-chassisd)
      Tasks: 14 (limit: 9501)
     Memory: 132.4M
     CGroup: /system.slice/config-chassisdb.service
                        ├─571 /bin/bash /usr/bin/config-chassisdb
			├─575 /usr/bin/python3 /usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform
			├─602 /bin/sh -c sudo decode-syseeprom -m
			├─603 sudo decode-syseeprom -m
			├─607 /usr/bin/python3 /usr/local/bin/decode-syseeprom -m
			├─616 /bin/sh -c docker --version 2>/dev/null
			└─617 docker --version
- How I did it
Use an alternative way to implement this function and issue can be avoided:

docker_env_file = '/.dockerenv'
return os.path.exists(docker_env_file) is False

- How to verify it
run regression on real hardware and simx platform.
2022-12-20 09:59:24 +02:00
..
barefoot [202205][Arista] Update platform library submodules (#12968) 2022-12-07 14:59:29 -08:00
broadcom update SAI version to 7.1.28.4 (#13072) 2022-12-16 19:07:31 +08:00
cavium Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
centec [202205] Update Linux kernel from 5.10.103 to 5.10.140 (#12660) #12874 2022-12-01 09:25:40 -08:00
centec-arm64 [centec][arm64] fix tsingma bsp compile error (#12774) 2022-12-06 18:35:30 +08:00
checkout update cisco 8000 tag: 202205-v0.6 (#12580) 2022-11-03 08:58:07 +08:00
components [gbsyncd] Enable debug shell for BRCM broncos PHY (#12622) 2022-11-10 18:15:51 +00:00
generic [dockers] Rename 'docker-snmp-sv2' to 'docker-snmp' (#4699) 2020-06-11 16:04:23 -07:00
innovium [innovium]: Enable syncd container autorestart for Innovium platforms (#11497) 2022-09-21 21:10:23 +00:00
marvell [202205][BRCM_SAI] update Brcm SAI dependencies (#11173) 2022-06-17 05:02:00 -07:00
marvell-arm64 Support symcrypt fips config for aboot/uboot (#10729) 2022-06-05 15:20:20 +00:00
marvell-armhf [Marvell] Update armhf sai debian (#13037) 2022-12-14 12:10:09 +08:00
mellanox [202205][Mellanox] change the implementation of is_host() to fix a stuck issue on simx platform (#13101) 2022-12-20 09:59:24 +02:00
nephos Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
p4 Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
pddf Fix for Accton platform build failure when doing incremental build (#10541) 2022-05-09 12:17:38 -07:00
template Mount directory warmboot in docker gbsyncd (#11852) 2022-08-27 16:16:17 +00:00
vs [sai-ptf]Fix sai ptf issue (#12723) 2022-11-16 20:28:30 -08:00