[I first posted essentially this question in the RPi Troubleshooting forum, but no takers. I have now tried exactly the same thing in a fresh install of stock Debian 12 on a separate machine. Same behaviour, so this doesn't seem to be RPi-specific. I'm hoping that one of the Debian network gurus will be able to set me straight. For context, I have not made any changes to the network configuration beyond plugging in a wifi dongle and using the Gnome widget to connect to my home wifi. The wlan interface name below is the one that was chosen automagically.]
I have a script that I want to be executed when the wireless lan interface is taken down. I have tried both the following: a) place a script in /etc/network/if-down.d; b) place a script in /etc/NetworkManager/dispatcher.d. As far as I can tell, a) has no effect (the script is never run). For b) the script is run sometimes, but not when the wlan interface is taken down. For debugging purposes I have this:Having checked that wlan0 is up, I doNothing is written to the tmp file at all.
I then doThe following is written:Note that only the dhcp events are logged, no "up" event.
One additional data point: if I reboot with that script in place in /etc/NetworkManager/dispatcher.d, an "up" event is logged in the tmp file, so it seems that things do behave the way I was expecting when the wlan is first brought up.
Any ideas?
I have a script that I want to be executed when the wireless lan interface is taken down. I have tried both the following: a) place a script in /etc/network/if-down.d; b) place a script in /etc/NetworkManager/dispatcher.d. As far as I can tell, a) has no effect (the script is never run). For b) the script is run sometimes, but not when the wlan interface is taken down. For debugging purposes I have this:
Code:
> cat /etc/NetworkManager/dispatcher.d/00-log-iface-events.sh#!/usr/bin/env bashinterface=$1event=$2echo "===========" >> /tmp/Hello-there.txtecho "$interface received $event" >> /tmp/Hello-there.txt
Code:
sudo ip link set wlan0 down
I then do
Code:
sudo ip link set wlan0 up
Code:
===========wlx7cdd905b9c3d received dhcp4-change===========wlx7cdd905b9c3d received dhcp6-change
One additional data point: if I reboot with that script in place in /etc/NetworkManager/dispatcher.d, an "up" event is logged in the tmp file, so it seems that things do behave the way I was expecting when the wlan is first brought up.
Any ideas?
Statistics: Posted by seberoon — 2024-09-26 21:02 — Replies 0 — Views 13