Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 238277 - net-misc/dhcp add init script multiplexing support
Summary: net-misc/dhcp add init script multiplexing support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-21 13:22 UTC by Roy Marples
Modified: 2011-03-05 23:52 UTC (History)
2 users (show)

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


Attachments
Allow multiplexing of dhcpd init script (dhcpd.diff,1.43 KB, patch)
2008-09-21 13:23 UTC, Roy Marples
Details | Diff
Patch to enable ISC DHCP multiplexing (starting) - for IPv4 and IPv6 usage (dhcpd.patch,1.43 KB, patch)
2009-04-16 01:13 UTC, Mihai Moldovan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Marples 2008-09-21 13:22:14 UTC
dhcp-4 allows the use of a DHCPv6 server. This requires running another server instance if you wish to allow DHCPv4 as well. The current init script does not easily multiplex. This patch should, allowing you to ln -s dhcpd /etc/init.d/dhcpd6 and then creating /etc/dhcp/dhcpd6.conf.
Comment 1 Roy Marples 2008-09-21 13:23:06 UTC
Created attachment 165992 [details, diff]
Allow multiplexing of dhcpd init script
Comment 2 Mihai Moldovan 2009-04-16 01:13:59 UTC
Created attachment 188516 [details, diff]
Patch to enable ISC DHCP multiplexing (starting) - for IPv4 and IPv6 usage

Hi guys,

this issue is hanging around for some time now, what's up?

I'd like to bump this bug and add a new version of the suggested patch (though modified, I hope you'll like it.)

Also, could the maintainer please drop a message on it?

Thank you very much.
Comment 3 Roy Marples 2009-04-16 06:12:08 UTC
(In reply to comment #2)
> Created an attachment (id=188516) [edit]
> Patch to enable ISC DHCP multiplexing (starting) - for IPv4 and IPv6 usage

Please don't use sed (or any external tool) in global scope.
You want something like so

case "${SVCNAME}" in
*6*) DHCPD_OPTS="${DHCPD_OPTS} -6"
*)   DHCPD_OPTS="${DHCPD_OPTS} -4"
esac

Also, you cannot assume ipv6 just because of the existance of the number 6 in the SVCNAME so I would argue that it's wrong anyway.
Comment 4 Mihai Moldovan 2009-04-17 01:46:45 UTC
Hi Roy,

(In reply to comment #3)
> Please don't use sed (or any external tool) in global scope.
Sorry, I didn't know that as of now.
Due to the fact that sed has been used in this eBuild as well before (have a look at the get_var function), I have assumed that it is safe to use.

Of course, your suggestion is good, too. 

But coming to think of "global scope", the check is at the wrong position anyways. It really should be moved into start(), because it's only used in this function.


> Also, you cannot assume ipv6 just because of the existance of the number 6 in
> the SVCNAME so I would argue that it's wrong anyway.
Well, why not? It's a quick, easy and reliable way to check for IPv6 usage.
When running dhcpd in IPv6 mode, it is natural to me to specifiy a six *somewhere* in the symbolic link, no?
"Hardcoding"/checking for i.e. "dhcp6" is no better way, because some people may actually want to call the symlink "dhcpv6" or something like this, you'll get it...

To me this has been a question of freedom. Of course you can also check for SVCNAME being "dhcp6", but I do like the generic way.

I am awaiting your thoughts on this matter. :)


--Ionic
Comment 5 Roy Marples 2009-04-17 06:36:39 UTC
(In reply to comment #4)
> But coming to think of "global scope", the check is at the wrong position
> anyways. It really should be moved into start(), because it's only used in this
> function.

Correct

> > Also, you cannot assume ipv6 just because of the existance of the number 6 in
> > the SVCNAME so I would argue that it's wrong anyway.
> Well, why not? It's a quick, easy and reliable way to check for IPv6 usage.
> When running dhcpd in IPv6 mode, it is natural to me to specifiy a six
> *somewhere* in the symbolic link, no?
> "Hardcoding"/checking for i.e. "dhcp6" is no better way, because some people
> may actually want to call the symlink "dhcpv6" or something like this, you'll
> get it...
> 
> To me this has been a question of freedom. Of course you can also check for
> SVCNAME being "dhcp6", but I do like the generic way.
> 
> I am awaiting your thoughts on this matter. :)

/etc/init.d/dhcp1
/etc/init.d/dhcp2
/etc/init.d/dhcp3
/etc/init.d/dhcp4
/etc/init.d/dhcp5
/etc/init.d/dhcp7
/etc/init.d/dhcp8

Using your idea, dhcp6 is ipv6. So it must follow that dhcp4 is ipv4 and the others are unknown.

After working with stuff being implied by a fixed name (think interface names) and then the user being given the ability to change the name, every inference is wrong. You can call a bonded interface br0 to confuse things. Whilst silly, it's possible and has happened.

So no, interering a state or action based on a user defined name hazardous and should be avoided.
Comment 6 Mihai Moldovan 2009-04-17 14:36:44 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > But coming to think of "global scope", the check is at the wrong position
> > anyways. It really should be moved into start(), because it's only used in this
> > function.
> 
> Correct

ACK :)

> > > Also, you cannot assume ipv6 just because of the existance of the number 6 in
> > > the SVCNAME so I would argue that it's wrong anyway.
> > Well, why not? It's a quick, easy and reliable way to check for IPv6 usage.
> > When running dhcpd in IPv6 mode, it is natural to me to specifiy a six
> > *somewhere* in the symbolic link, no?
> > "Hardcoding"/checking for i.e. "dhcp6" is no better way, because some people
> > may actually want to call the symlink "dhcpv6" or something like this, you'll
> > get it...
> > 
> > To me this has been a question of freedom. Of course you can also check for
> > SVCNAME being "dhcp6", but I do like the generic way.
> > 
> > I am awaiting your thoughts on this matter. :)
> 
> /etc/init.d/dhcp1
> /etc/init.d/dhcp2
> /etc/init.d/dhcp3
> /etc/init.d/dhcp4
> /etc/init.d/dhcp5
> /etc/init.d/dhcp7
> /etc/init.d/dhcp8
> 
> Using your idea, dhcp6 is ipv6. So it must follow that dhcp4 is ipv4 and the
> others are unknown.
> 
> After working with stuff being implied by a fixed name (think interface names)
> and then the user being given the ability to change the name, every inference
> is wrong. You can call a bonded interface br0 to confuse things. Whilst silly,
> it's possible and has happened.
> 
> So no, interering a state or action based on a user defined name hazardous and
> should be avoided.
> 

Thus your suggestion would be using a unique name like "dhcpv6" or something similar?

--Ionic
Comment 7 Roy Marples 2009-04-17 14:43:46 UTC
(In reply to comment #6)
> Thus your suggestion would be using a unique name like "dhcpv6" or something
> similar?

No, my suggestion is don't infer anything from the name - the user has to explicitly request DHCPv6 support in another variable.
Comment 8 SpanKY gentoo-dev 2011-03-05 23:52:07 UTC
included Roy's patch with dhcp-4.2.1