<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14126</bug_id>
          
          <creation_ts>2020-11-14 10:19:50 +0000</creation_ts>
          <short_desc>resolvconf incompatible with busybox flock</short_desc>
          <delta_ts>2025-05-15 18:19:09 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>3.1.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Berger">pokylinux</reporter>
          <assigned_to name="Randy MacLeod">randy.macleod</assigned_to>
          <cc>kai.kang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>tgamblin</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88612</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2020-11-14 10:19:50 +0000</bug_when>
    <thetext>It looks like this was introduced to /bin/resolvconf:

git log --source -S &apos;flock&apos; -- resolvconf
commit ad69ba122e69f96d10349bea82400e96ad6f0942   HEAD (tag: ubuntu/1.79ubuntu13)
Author: Alfonso Sanchez-Beato (email Canonical) &lt;alfonso.sanchez-beato@canonical.com&gt;
Date:   Wed Apr 17 16:53:53 2019 +0200

    bin/resolvconf: use flock so resolvconf can be called in parallel safely
    
    LP: #1825194
    
    (resolvconf 1.79ubuntu13)

----

in the code:

# Make sure that we do not end up with a broken resolv.conf if resolvconf
# is invoked in parallel.
LOCK_WAIT_S=10
flock -w $LOCK_WAIT_S 9 ||
        { report_err &quot;Run lock held by another process for longer than $LOCK_WAIT_S seconds&quot;; exit 1; }


...but...

the busybox version of flock does not contain the -w flag.

This means that if you want to use resolvconf e.g. with core-image-minimal it won&apos;t work.

One solution would be to use a more complete version of flock like the one util-linux provides.

I suggest adding something like this to

./meta/recipes-connectivity/resolvconf/resolvconf_1.82.bb

RDEPENDS_${PN} = &quot;util-linux-flock&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89778</commentid>
    <comment_count>1</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2021-03-26 01:24:38 +0000</bug_when>
    <thetext>I suppose it is the right fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89779</commentid>
    <comment_count>2</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2021-03-26 02:00:17 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; It looks like this was introduced to /bin/resolvconf:
&gt; 
&gt; git log --source -S &apos;flock&apos; -- resolvconf
&gt; commit ad69ba122e69f96d10349bea82400e96ad6f0942   HEAD (tag:
&gt; ubuntu/1.79ubuntu13)
&gt; Author: Alfonso Sanchez-Beato (email Canonical)
&gt; &lt;alfonso.sanchez-beato@canonical.com&gt;
&gt; Date:   Wed Apr 17 16:53:53 2019 +0200
&gt; 
&gt;     bin/resolvconf: use flock so resolvconf can be called in parallel safely
&gt;     
&gt;     LP: #1825194
&gt;     
&gt;     (resolvconf 1.79ubuntu13)
&gt; 
&gt; ----

Hi Robert,

Which branch are you working on? I didn&apos;t see this patch in master and dunfell.

Regards,
Kai</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90066</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-04-22 15:26:47 +0000</bug_when>
    <thetext>Question of whether busybox can support the -w and we need to change config or whether we should depend on util-linux. Someone needs to invetigate.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90119</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-04-26 13:42:19 +0000</bug_when>
    <thetext>1) resolvconf wants:

# Make sure that we do not end up with a broken resolv.conf if resolvconf
# is invoked in parallel.
LOCK_WAIT_S=10
flock -w $LOCK_WAIT_S 9

2) standard flock(1)[1] supports -w:

-w, --wait, --timeout seconds
              Fail if the lock cannot be acquired within seconds.
              Decimal fractional values are allowed.  See the -E option
              for the exit status used. The zero number of seconds is
              interpreted as --nonblock.

3) busybox does not seem to support anything like that out of the box:

opt = getopt32long(argv, &quot;^+&quot; &quot;sxnu&quot; &quot;\0&quot; &quot;-1&quot;, flock_longopts);

[1] https://man7.org/linux/man-pages/man1/flock.1.html 
[2] https://git.busybox.net/busybox/tree/util-linux/flock.c#n16

So I would say that we 
*) either need to implement -w in busybox or 
*) use util-linux-flock instead - 
*) or change the resolconf script in some way which does not need it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90120</commentid>
    <comment_count>5</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-04-26 13:57:27 +0000</bug_when>
    <thetext>With the latest and greatest master branch I just made a resolvconf_1.87.bbappend file and added:

RDEPENDS_${PN} = &quot;util-linux-flock&quot;

But now I also get:

ERROR: resolvconf-1.87-r0 do_package_qa: QA Issue: /lib/resolvconf/list-records contained in package resolvconf requires /bin/bash, but no providers found in RDEPENDS_resolvconf? [file-rdeps]

which means we also need bash:

RDEPENDS_${PN} = &quot;util-linux-flock bash&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90121</commentid>
    <comment_count>6</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-04-26 14:49:03 +0000</bug_when>
    <thetext>and the party goes on:

in runtime:

echo &quot;nameserver 1.1.1.1&quot; | resolvconf -a dummy.if
readlink: invalid option -- &apos;m&apos;
BusyBox v1.33.0 () multi-call binary.

Usage: readlink [-fnv] FILE
/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90122</commentid>
    <comment_count>7</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2021-04-26 17:15:25 +0000</bug_when>
    <thetext>after adding this, which made it work:
RDEPENDS_${PN} = &quot;util-linux-flock bash coreutils&quot;

the image size of something like a core-image-minimal grew from:
IMAGESIZE = 51116 --&gt; IMAGESIZE = 56312

4399	KiB	coreutils
289	KiB	libgmp10
35	KiB	coreutils-stdbuf
22	KiB	util-linux-flock
21	KiB	libacl1

... not sure this is what we want ;)

RP?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91856</commentid>
    <comment_count>8</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-10-28 17:51:22 +0000</bug_when>
    <thetext>Robert, best way to find out if RP likes the change is to send a patch to the list...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92996</commentid>
    <comment_count>9</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2022-04-11 22:29:06 +0000</bug_when>
    <thetext>Still no -w option for busybox flock</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96108</commentid>
    <comment_count>10</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-07-26 21:29:36 +0000</bug_when>
    <thetext>Bulk move to 4.3 M3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96498</commentid>
    <comment_count>11</comment_count>
    <who name="Trevor Gamblin">tgamblin</who>
    <bug_when>2023-09-14 16:55:30 +0000</bug_when>
    <thetext>Moved to M4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98804</commentid>
    <comment_count>12</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-04-25 01:07:07 +0000</bug_when>
    <thetext>Still no -w option for busybox flock
Move to 5.99 since no one is actively working on this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101187</commentid>
    <comment_count>13</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-02-20 16:28:49 +0000</bug_when>
    <thetext>Apply patch then it becomes an enhancement.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>