Bug 12021 - Scripts in if-down.d and if-post-down.d are not run when taking down network
Summary: Scripts in if-down.d and if-post-down.d are not run when taking down network
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.30.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-09 16:45 UTC by Daniele Testa
Modified: 2019-07-09 16:45 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniele Testa 2019-07-09 16:45:56 UTC
if the directories /etc/network/{if-down.d,if-post-down.d} does not exist, the command "ifdown" will complain that they are missing.

But, even if they exist and have scripts in them (with chmod +x), they are NOT executed when running "ifdown".

Files in "if-pre-up.d" are executed correctly on "ifup". Seems it's only an issue with the down-scripts.

To replicate the error, put a simple test-script like "touch /tmp/down" in the "if-down.d" directory and run "ifdown -a"

Strangely enough, using the "down" parameter in /etc/network/interfaces DOES work.

Something like this works:

auto mlan0
iface mlan0 inet manual
down touch /tmp/down

So, I can work around this bug by putting "down run-parts /etc/network/if-down.d", but it's a very ugly solution in my opinion. Is this a known issue/bug or am I doing something wrong?