From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] busybox: udhcpc create leases file
Date: Thu, 30 Apr 2015 22:03:01 +0200 [thread overview]
Message-ID: <55428A75.7000401@mind.be> (raw)
In-Reply-To: <87vbgdvezw.fsf@dell.be.48ers.dk>
On 04/30/15 16:59, Peter Korsgaard wrote:
>>>>>> "Matthew" == Matthew Weber <matthew.weber@rockwellcollins.com> writes:
>
> Hi,
>
> >> > + # Based on http://sourceforge.net/p/kboot/mailman/message/1168535/
> >>
> >> A more detailed commit message would be good. After looking at that URL
> >> I'm still not quite sure what this is needed for? It doesn't seem to be
> >> read again anywhere.
>
> > Sorry, I can add that. In general, it adds the leases functionality
> > that mimics full dhclient behavior. This file can then be used at a
> > system level to know least expiration and other server provided
> > information.
>
> Ok, good. Is that really something we want to enforce for everyone using
> udhcpc with Buildroot?
I don't see why not. It's creating a small file in /tmp, that's all. Except for
the appending, of course, otherwise a long-running system could just fill up
/tmp with leases. Overwriting has the disadvantage that there's a race condition
when the file is truncated at the same time that another process is reading from
it, but I don't think the complexity of fixing that race is worth the bother.
Regards,
Arnout
>
> >>> + } >> /var/lib/misc/udhcpc-$interface.leases
> >>
> >> Are you sure this should append the file and not overwrite it? Why would
> >> you want to keep older lease info around when you receive a new one?
>
> > I just mimic'd dhclient but I could see in a embedded space you might
> > only want to keep the latest and when a lease expires, removing this
> > file. I think the full client usually used this file to set an
> > interface after reboot to the previous lease if one was still valid.
> > I wasn't going to keep this behavior since for embedded devices it
> > doesn't make sense.
>
> Ok.
>
> >>
> >> Perhaps this belongs in a hook in your rootfs overlay?
>
> > Right now there isn't any way to get dhcp lease information after a
> > lease is provided. It seemed this should be a standard capability of
> > the script. I do agree I should make it not append and clean up when
> > there isnt' a lease.
>
> I'm still not convinced this isn't something that belongs in a project
> specific rootfs overlay instead. That's part of the reason why we now
> support custom hooks in the udhcpc script.
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
next prev parent reply other threads:[~2015-04-30 20:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 1:41 [Buildroot] [PATCH 1/1] busybox: udhcpc create leases file Matt Weber
2015-04-30 14:31 ` Peter Korsgaard
2015-04-30 14:48 ` Matthew Weber
2015-04-30 14:59 ` Peter Korsgaard
2015-04-30 16:23 ` Matthew Weber
2015-04-30 20:03 ` Arnout Vandecappelle [this message]
2015-05-01 21:13 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55428A75.7000401@mind.be \
--to=arnout@mind.be \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox