681c24878b
Why I did it The PR is aimed to fix a bug that mgmt port eth0 may loss IP even if user configured static IP of eth0. This is not a always reproduceable issue, the reproducing flow is like: Systemd starts networking service, which runs a dhcp based configuration and assigned an ip from dhcp. Systemd starts interface-config service who depends on networking service Interface-config service runs command “ifdown –force eth0”, check line. but networking service is still running so that this line failed with error: “error: Another instance of this program is already running.”. This error is printed by ifupdown2 lib who is the main process of networking service. So, ifdown actually does not work here, the ip of eth0 is not down. Interface-config service updates /etc/networking/interface to static configuration. Interface-config service runs command “systemctl restart networking”. This command kills the previous networking related processes (log: networking.service: Main process exited, code=killed, status=15/TERM), and try to reconfigure the ip address with static configuration. But it detects that the configured IP and the existing IP are the same, and it does not really configure the ip to kernel. Hence, the ip is still getting from dhcp. (this could be a bug of ifupdown2: previous ip is from dhcp, new ip is a static ip, it treats them as same instead of re-configuring the IP) When the lease of the ip expires, the ip of eth0 is removed by kernel and the issue reproduces. The issue is not always reproduceable because networking service usually runs fast so that it won't hit step#3. How I did it Check networking service state before running "ifdown –force eth0", wait for it done if it is activating. How to verify it Manual test. |
||
---|---|---|
.. | ||
bash | ||
config-chassisdb | ||
config-setup | ||
constants | ||
copp | ||
corefile_uploader | ||
cron.d | ||
ebtables | ||
environment | ||
fstrim | ||
hostname | ||
interfaces | ||
kdump | ||
kubernetes | ||
logrotate | ||
misc | ||
monit | ||
ntp | ||
pcie-check | ||
platform | ||
rsyslog | ||
secureboot | ||
snmp | ||
sudoers | ||
sysctl | ||
syslog | ||
system-health | ||
systemd | ||
topology | ||
updategraph | ||
warmboot-finalizer | ||
watchdog-control |