mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
parent
0d41fc21fa
commit
f8cd43576a
@ -5,6 +5,7 @@
|
||||
shell: |
|
||||
ip link >/dev/null || exit 1
|
||||
|
||||
CHANGED=''
|
||||
for FILE in ifcfg-*; do
|
||||
# skip interfaces disabled "on boot"
|
||||
if grep -q -i '^ONBOOT=["'\'']no'; then
|
||||
@ -17,9 +18,21 @@
|
||||
|
||||
# if interface does not exist, disable configuration
|
||||
if ! ip link show ${IFACE} >/dev/null 2>&1; then
|
||||
CHANGED=yes
|
||||
mv ${FILE} disabled-${FILE}
|
||||
fi
|
||||
done
|
||||
|
||||
# As a result of obsolete configuration, the network service
|
||||
# could end up in the failed state. Restart of the networking
|
||||
# might fail later, because only service start is triggered
|
||||
# (without prior stop). We try to manually put the interfaces down,
|
||||
# and restart the networking to fix the service state.
|
||||
# https://github.com/OpenNebula/one/issues/3080
|
||||
if [ -n "${CHANGED}" ] && systemctl is-failed network.service >/dev/null 2>&1; then
|
||||
ifdown ifcfg-* || :
|
||||
systemctl restart network.service
|
||||
fi
|
||||
args:
|
||||
executable: /bin/bash
|
||||
chdir: /etc/sysconfig/network-scripts
|
||||
|
Loading…
x
Reference in New Issue
Block a user