[Buildroot] [PATCH v3 11/13] package/dhcp: systemd: support IPv6 lease file

Benoît Thébaudeau benoit.thebaudeau.dev at gmail.com
Sun Nov 15 17:55:32 UTC 2015


Hi Maxime, all,

On Thu, Nov 12, 2015 at 11:42 AM, Maxime Hadjinlian
<maxime.hadjinlian at gmail.com> wrote:
> On Mon, Nov 9, 2015 at 11:49 AM, Benoît Thébaudeau <benoit at wsystem.com>
> wrote:
>> On 04/11/2015 12:31, Maxime Hadjinlian wrote:
>> >     >     A single instance of dhcpd cannot be run with
>> >     >     both '-4' and '-6'. I don't know if it's possible (or
>> > desirable) to safely run
>> >     >     simultaneously two instances of dhcpd, one with '-4' and the
>> > other one with
>> >     >     '-6'.
>> >     >
>> >     > Well it could be useful if you are trying to build a network
>> > appliance and you want to support both stack. So you would want to start two
>> > processes with different options. Maybe that's something that should be left
>> > to the users to figure out.
>> >
>> >     Yes, but should everything be duplicated in Buildroot just for this
>> > purpose? For
>> >     SysV, it's easy not to duplicate things, but how would you do that
>> > with systemd?
>> >     How do distributions handle this?
>> >
>> > I only looked at Arch Linux, they duplicate the service file. It's also
>> > possible to use the template mechanisms in systemd, to have something like
>> > dhcpd at .service and when you enable it, you create a symlink called
>> > dhcpd at 4.service, and the '4' is passed as argument to the template and you
>> > can use it however you want it to.
>>
>> Ubuntu duplicates the service files too. And all the service files come
>> from the
>> same package.
>>
>> How do we want to handle that in Buildroot?
>> 1/ Always start IPv4 and IPv6 instances like Ubuntu does. This is wasting
>>    resources if one of them is actually unused.
>> 2/ Add a Kconfig choice - common to all the selected DHCP daemons -
>> between
>>    "only IPv4", "only IPv6", and "IPv4 + IPv6".
>> 3/ Use /etc/default/dhcpd and the like. We could detect the presence of
>>    /etc/default/dhcpd vs. /etc/default/dhcpd6, or of some variables in
>> them, or
>>    of /etc/dhcp/dhcpd.conf vs. /etc/dhcp/dhcpd6.conf. Something like that
>> seems
>>    to be easier to use, but less obvious for users unless well documented.
>>
> In my humble opinion, I would go for the Kconfig options as I find this
> easier for the end user and to maintain.

Actually, I've just noticed that, while it installs both IPv4 and IPv6
startup mechanisms, Ubuntu uses ConditionPathExists with
/etc/dhcp/dhcpd.conf and /etc/dhcp/dhcpd6.conf to skip the dhcpd
service if its required configuration file is not present, just like
what is currently done by Buildroot's S80dhcp-server. In Buildroot,
that would mean having to tweak the rootfs overlay and/or the
post-build script to choose what to run. This would have to be done
anyway with Kconfig options in order not to keep the default
dhcpd.conf, which is not very useful, so it may be more flexible not
to have Kconfig options. Thomas?


More information about the buildroot mailing list