ignore dpkg files when running hook scripts #304
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently ifupdown2 executes scripts that are backed up by dpkg (e.g. foo.dpkg-old). This can lead to issues with hook scripts getting executed after upgrading ifupdown2 via dpkg, even though they should not be executed.
This also brings ifupdown2 closer on par with the behavior of ifupdown, which did not execute hook scripts with dpkg suffixes.
We had the following issue occur a few times:
ifupdown
andifenslave
installed that has a bond configured in/etc/network/interfaces
.ifenslave
installs a script/etc/network/if-pre-up.d/ifenslave
./etc/network/if-pre-up.d/ifenslave.dpkg-new
. Asifupdown
executes network scripts viarun-parts
which ignores scripts with.
in their name,ifenslave.dpkg-new
has no effect.ifupdown2
by installing it (removingifupdown
, keepingifenslave
) and reboots, the network will not come up:/etc/network/if-pre-up.d/ifenslave
still exists, but is ignored by ifupdown2's bond addon [1]/etc/network/if-pre-up.d/ifenslave.dpkg-new
is executed byifupdown2
because it executes all scripts in/etc/network/if-pre-up.d
, even if their name contains a dotThis leads to broken network configuration on upgrades, where users did have no network.
[1]
ifupdown2/ifupdown2/addons/bond.py
Line 45 in ccdc386