It looks like this was introduced to /bin/resolvconf: git log --source -S 'flock' -- resolvconf commit ad69ba122e69f96d10349bea82400e96ad6f0942 HEAD (tag: ubuntu/1.79ubuntu13) Author: Alfonso Sanchez-Beato (email Canonical) <alfonso.sanchez-beato@canonical.com> 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 "Run lock held by another process for longer than $LOCK_WAIT_S seconds"; 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'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} = "util-linux-flock"
I suppose it is the right fix.
(In reply to comment #0) > It looks like this was introduced to /bin/resolvconf: > > git log --source -S 'flock' -- resolvconf > commit ad69ba122e69f96d10349bea82400e96ad6f0942 HEAD (tag: > ubuntu/1.79ubuntu13) > Author: Alfonso Sanchez-Beato (email Canonical) > <alfonso.sanchez-beato@canonical.com> > 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) > > ---- Hi Robert, Which branch are you working on? I didn't see this patch in master and dunfell. Regards, Kai
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.
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, "^+" "sxnu" "\0" "-1", 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.
With the latest and greatest master branch I just made a resolvconf_1.87.bbappend file and added: RDEPENDS_${PN} = "util-linux-flock" 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} = "util-linux-flock bash"
and the party goes on: in runtime: echo "nameserver 1.1.1.1" | resolvconf -a dummy.if readlink: invalid option -- 'm' 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
after adding this, which made it work: RDEPENDS_${PN} = "util-linux-flock bash coreutils" the image size of something like a core-image-minimal grew from: IMAGESIZE = 51116 --> 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?
Robert, best way to find out if RP likes the change is to send a patch to the list...
Still no -w option for busybox flock
Bulk move to 4.3 M3.
Moved to M4.
Still no -w option for busybox flock Move to 5.99 since no one is actively working on this.
Apply patch then it becomes an enhancement.