I have a box with Ubuntu 11.10 installed. And the box was configured to get IP and hostname from dhcp.
We have set to scripts in /etc/dhcp/dhclient-enter-hooks.d/ folder. But these scripts were not invoked/executed. I have similar scripts in another box, which has Ubuntu 10.04 installed and hook scripts executes without issues. One difference is that in the 11.10 box has NetworkManager installed.
# ps -ef | grep dhclient
root 746 695 0 03:52 ? 00:00:00 /sbin/dhclient -d -4 -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/lib/dhcp/dhclient-559273da-a027-458e-b124-bdbb4976ee17-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0
How did I test that the script in /etc/dhcp/dhclient-enter-hooks.d was not running? I have placed a simple script "mytest" which has below code in /etc/dhcp/dhclient-enter-hooks.d. The file /tmp/enter-hook.out was never generated.
#!/bin/sh
echo "this is test file to test dhclient-enter-hook" > /tmp/enter-hook.out
Snip of my /etc/network/interfaces
# cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0 inet dhcp