Bug#1012154: binfmt-support.service errors with "unable to close /proc/sys/fs/binfmt_misc/register: File exists"

Michael Biebl biebl at debian.org
Thu Jun 2 12:01:11 BST 2022


Control: reassign -1 binfmt-support
Control: tags -1 + patch

Am 02.06.22 um 11:16 schrieb Michael Biebl:
> Am 01.06.22 um 13:18 schrieb Colin Watson:
>> On Wed, Jun 01, 2022 at 11:25:21AM +0200, Michael Biebl wrote:
>>> what you see here is a race condition between binfmt-support.service and
>>> systemd-binfmt.service.
>>> E.g. qemu installs binfmt config files for both binfmt-support and
>>> systemd-binfmt leading to the issue you see.
>>>
>>> I plan to add a
>>> ConditionFileIsExecutable=!/usr/sbin/update-binfmts
>>> to systemd-binfmt.service. This will disable systemd-binfmt.service when
>>> binfmt-support is installed and should mitigate this issue.
>>> (thus reassigning to systemd)
>>
>> Thanks for investigating that.
> 
> Thinking more about it, it might actually be preferrable, if this 
> condition is shipped by binfmt-support via a drop-in config for 
> systemd-binfmt.service.

Thinking about this a bit more, binfmt.d might not strictly be a subset 
of the config files shipped for binfmt-support.
So disabling systemd-binfmt.service via a Condition might not be the 
best way forward.

Since we only need to ensure, that systemd-binfmt.service and 
binfmt-support.service do not run concurrently (and both trying to 
access /proc/sys/fs/binfmt_misc/register), we simply need to apply a 
proper ordering.
Thankfully, this is rather simple and the attached patch is even more 
minimal then the previous one.
I chose to run binfmt-support.service after systemd-binfmt.service, as 
the former is pulled in via multi-user.target and the latter via 
sysinit.target.

Regards,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Run-binfmt-support.service-after-systemd-binfmt.serv.patch
Type: text/x-patch
Size: 1783 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20220602/d6504673/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20220602/d6504673/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list