1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00
Roopa Prabhu e308cb8280 add new ifupdown2.conf option ifreload_down_changed to control ifreload
ifdown behaviour.

Ticket: CM-5819
Reviewed By: CCR-2846
Testing Done: tested ifreload evo test case

ifreload_down_changed is 0 by default which will make
sure ifreload will not execute down on changed interfaces
but only on deleted interfaces making it non-disruptive.

some notes from CCR:

ifreload was designed to be an optimization for 'service networking
restart' or 'ifdown -a + ifup -a'.
essentially it is a combination of 'ifdown + ifup' with some smarts in
which interfaces it will execute ifdown on.

By default it does the below:
ifdown all interfaces that were deleted from the interfaces file
ifdown all interfaces that were changed from the last time they were
ifup'ed
ifup -a (execute ifup on all interfaces marked auto)

Did not realize people will use ifreload as much as they do today. Also,
they may execute it on a production box when changes are made. ifdown on a production box can be
disruptive because if the ifdown which is part of the ifreload.

To have a non-disruptive option to ifreload, 2.5 added a new option -c
that only executed 'ifup' on all interfaces. Thus reloading all auto +
any other interfaces that were once brought up on the box (essentially
all interfaces present in the saved state file). This by default did not
do anything to the interfaces that got deleted from the file. But had an
ifupdown2.conf toggle to do so.

Looking at the evo use case, they do want to use a single command that
modifies, adds, deletes with
minimum disruption. we can achieve maybe what they want with multiple
commands (But there is also a case of a bug in the build evo is running
which makes it not so easy ).

This patch fixes the bug and also tries to change the default ifreload
behaviour controllable via a variable in ifupdown2.conf.
when ifreload_down_changed=0 in ifupdown2.conf, ifreload will only
ifdown interfaces that were deleted
from the file but not the ones that changed. subsequent ifup as part of
ifreload on the interfaces
that changed will apply the delta. And ifreload_down_changed default
value is '0'.

WIth the patch, ifreload by default will do the below (going back to the
previous default is just a toggle in the ifupdown.conf file):
ifdown all interfaces that were deleted from the interfaces file
ifup -a (execute ifup on all interfaces marked auto)

It sounds like a big change of behaviour for a hotfix release, but
essentially the patch just moves a few things around. And the change in
behaviour is so subtle that it is not very visible.
It just makes it non-disruptive.
(cherry picked from commit 2f7977834d4912a69159d27e54ba201f58a321d8)
2015-04-25 19:12:16 -07:00

45 lines
1.3 KiB
Plaintext

#
# ifupdown2 configuration file
#
# This file contains default settings for ifupdown
#
# default template engine (only mako is currently supported)
template_engine=mako
# default template lookup path during template rendering
template_lookuppath=/etc/network/ifupdown2/templates
# Support /etc/network/if-*/ scripts
addon_scripts_support=0
# By default ifupdown2 only supports a single vlan filtering bridge
# on the system. Set this flag to 1 to support multiple vlan
# filtering bridges
multiple_vlan_aware_bridge_support=0
# ifquery check status strings.
# By default `ifquery --check` prints the check and
# cross marks against interface attributes.
# Use the below strings to modify the default behaviour.
#
ifquery_check_success_str=[pass]
ifquery_check_error_str=[fail]
ifquery_check_unknown_str=
#
# This attribute controls iface/vlan range expansions
# in ifquery default output.
ifquery_ifacename_expand_range=0
# Let link master (bridges, bonds) own the link state of slaves
link_master_slave=1
# Delay admin state change till the end
delay_admin_state_change=0
# ifreload by default downs: 'all interfaces for which config changed' +
# 'interfaces that were deleted'. With the below variable set to '0'
# ifreload will only down 'interfaces that were deleted'
ifreload_down_changed=0