CodexBloom - Programming Q&A Platform

Fedora 37 - implementing Custom NetworkManager Dispatcher Script Not Triggering on DHCP Lease Renewal

👀 Views: 1 💬 Answers: 1 📅 Created: 2025-06-06
linux networking networkmanager bash

This might be a silly question, but I'm refactoring my project and This might be a silly question, but I'm experiencing an scenario with a custom NetworkManager dispatcher script on Fedora 37 that should execute when a DHCP lease is renewed, but it doesn't seem to trigger at all... The script is located in `/etc/NetworkManager/dispatcher.d/` and has the appropriate permissions set. Here's the script: ```bash #!/bin/bash if [ "$2" == "dhcp" ] && [ "$1" == "enp0s3" ]; then echo "DHCP lease renewed for interface $1" >> /var/log/dhcp_lease.log # Additional commands here fi ``` I've made sure to set the executable permission on the script using `chmod +x /etc/NetworkManager/dispatcher.d/myscript.sh`. I also confirmed that the NetworkManager service is running without any issues using `systemctl status NetworkManager`. However, when I renew the DHCP lease using `nmcli` or by reconnecting the network, there’s no entry in the log file, which suggests that the script isn’t being executed. I checked the log files at `/var/log/syslog` and `/var/log/NetworkManager/NetworkManager.log`, but there are no behavior messages related to my script. I’ve also tried using different interface names and simplified the script to just log a message, but it still doesn’t trigger. Is there a specific configuration or setting I might be missing that could prevent the dispatcher script from running? Any help would be greatly appreciated! This is part of a larger CLI tool I'm building. Any ideas what could be causing this? Is there a simpler solution I'm overlooking? I'm developing on Windows 10 with Bash.