Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 117763 - Call to dhclient-enter-hooks is missing
Summary: Call to dhclient-enter-hooks is missing
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2006-01-04 11:01 UTC by checimovic
Modified: 2006-01-13 05:07 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
dhclient-enter-hooks for baselayout-1.11 (baselayout-1.11-enter-hooks.patch,505 bytes, patch)
2006-01-05 02:45 UTC, Roy Marples (RETIRED)
Details | Diff
dhclient-enter-hooks for baselayout-1.12 (baselayout-1.12-enter-hooks.patch,607 bytes, patch)
2006-01-05 02:48 UTC, Roy Marples (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description checimovic 2006-01-04 11:01:25 UTC
Part of the new replacement for dhclient-script is /lib/rcscripts/net.modules.d/helpers.d/dhclient-udhcpc-wrapper. It includes a call to dhclient-exit-hooks, but doesn't have the corresponding call to dhclient-enter-hooks. This is a handy thing to have (well, I need it, anyway). The call should come right before the call to the dhclient script in dhclient-udhcpc-wrapper, as follows:

[[ -e /etc/dhcp/dhclient-enter-hooks ]] \
    && (. /etc/dhcp/dhclient-enter-hooks)

# Execute the dhclient script and exit with its code
/lib/rcscripts/net.modules.d/helpers.d/udhcpc-${iface_type} ${action}
.
.
.
etc.
Comment 1 Roy Marples (RETIRED) gentoo-dev 2006-01-04 17:13:01 UTC
As I understand it, you don't need enter-hooks unless you wish to modify the dhcp configuration process. As you probably aren't wanting to modify the configuration process but you want to add to the process then you want to use exit-hooks.

If you need enter-hooks, could you please state why?
Comment 2 checimovic 2006-01-04 17:38:26 UTC
As you said, dhclient-enter-hooks is nice because it allows you to do configuration with the ip, netmask, etc. before the interface is brought up. I admit, it's kind of an edge condition, but it can be very handy. Here's how I'm using it: 

I have a server A running dhcpd which is listening on eth1. Eth0 is using dhclient; eth1 is a static address (192.168.1.1). For debugging purposes, I plug another, identical, server B into A's lan. Now B's eth0 is given an address by A's dhcpd - let's say it is 192.168.1.254. But B's eth1 is still 192.168.1.1. So now we have a conflict. Rather than have our developers manually configure this each time, we have an enter-hooks script that reconfigures B's eth1 so it won't conflict with eth0. It won't work in exit-hooks, because eth0 will fail to come up because of the conflict. 

Anyway, the end result is that plugging one server into another magically "just works" because the ip range collision is detected and fixed. It's very convenient for us in testing.

The other reason to include a spot for enter-hooks is that the original dhclient-script has it, so removing it amounts to feature reduction ;)
Comment 3 Roy Marples (RETIRED) gentoo-dev 2006-01-05 02:45:47 UTC
Created attachment 76223 [details, diff]
dhclient-enter-hooks for baselayout-1.11

Will appear in baselayout-1.11.15
Comment 4 Roy Marples (RETIRED) gentoo-dev 2006-01-05 02:48:23 UTC
Created attachment 76224 [details, diff]
dhclient-enter-hooks for baselayout-1.12

Will be in baselayout-1.12.0_pre14
Comment 5 Roy Marples (RETIRED) gentoo-dev 2006-01-05 02:50:49 UTC
Patches applied to our svn repo
Comment 6 Roy Marples (RETIRED) gentoo-dev 2006-01-13 05:07:58 UTC
baselayout-1.12.0_pre14 is out