Bug 12021

Summary: Scripts in if-down.d and if-post-down.d are not run when taking down network
Product: Busybox Reporter: Daniele Testa <daniele.testa>
Component: NetworkingAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.30.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

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?