[PATCH 1/1] ifupdown: add write lock around ifstate access

Denys Vlasenko vda.linux at googlemail.com
Sun Oct 9 21:12:11 UTC 2016


On Thu, Sep 29, 2016 at 11:34 PM, Danomi Manchego
<danomimanchego123 at gmail.com> wrote:
> Denys,
>
> On Thu, Sep 29, 2016 at 12:25 PM, Denys Vlasenko
> <vda.linux at googlemail.com> wrote:
>> On Thu, Sep 29, 2016 at 5:04 AM, Danomi Manchego
>> <danomimanchego123 at gmail.com> wrote:
>>> So that concurrent access on systems with multiple
>>> network interfaces correctly update the ifstate file.
>>
>> Two or more concurrent ifups or ifdowns
>> are likely to trample over many more things than /var/run/ifstate
>>
>> For example, what about routing table entries they are removing
>> and adding?
>
> In our systems, we serialize ip route updates, dhcp updates, and
> resolv.conf mods through a proprietary application, so we didn't run
> into those issues.  We just needed a reliable if-up.d/if-down.d basis
> to dispatch messages to our app.
>
> I suppose that if you were updating those files directly in the
> if-xxx.d scripts, then it would be the script writer's responsibility
> to use something like flock to protect the shared assets.

Ok, I fixed this in git, however without fcntl-based locks.
(locking has a history of difficulties when implemented
over distributed filesystems).

Please check new code in git and yell at me if there's a problem.


More information about the busybox mailing list