a8376ef109
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. |
||
---|---|---|
.. | ||
__init__.py | ||
chassis.py | ||
component.py | ||
cpu_thermal_control.py | ||
device_data.py | ||
eeprom.py | ||
fan_drawer.py | ||
fan.py | ||
led.py | ||
module.py | ||
pcie.py | ||
platform.py | ||
psu.py | ||
sfp_event.py | ||
sfp.py | ||
thermal_actions.py | ||
thermal_conditions.py | ||
thermal_infos.py | ||
thermal_manager.py | ||
thermal.py | ||
utils.py | ||
vpd_parser.py | ||
watchdog.py |