I'm trying to leverage dhclient-script, and specifically the /etc/dhclient-exit-hooks hook. The actual purpose is because I want to redirect the generated /etc/resolv.conf to some place else, say /etc/resolv.conf.auto. However, I'm not having much luck. As I read through /sbin/dhclient-script it seems like I can put some necessary functions within /etc/dhclient-exit-hooks and it will get executed as various times during the process.
For debugging, I've started easy, with just this:
As far as I understand it, this should output something to console every time dhclient runs. I would expect to see it output some of the other states, like PREINIT, BOUND, etc. However, I'm only seeing "PREINIT" and none of the other states. dhclient is actually working, the interface gets an IP address. However, dhclient-script seems to only run one time, for PREINIT and never again.
Am I missing something fundamental? I'm using FreeBSD 9.0 release.
For debugging, I've started easy, with just this:
Code:
echo "Reason is - $reason"
As far as I understand it, this should output something to console every time dhclient runs. I would expect to see it output some of the other states, like PREINIT, BOUND, etc. However, I'm only seeing "PREINIT" and none of the other states. dhclient is actually working, the interface gets an IP address. However, dhclient-script seems to only run one time, for PREINIT and never again.
Am I missing something fundamental? I'm using FreeBSD 9.0 release.