#1012154 binfmt-support.service errors with "unable to close /proc/sys/fs/binfmt_misc/register: File exists" #1012154
- Package:
- binfmt-support
- Source:
- binfmt-support
- Description:
- Support for extra binary formats
- Submitter:
- Facundo Gaich
- Date:
- 2022-06-03 20:06:02 UTC
- Severity:
- important
- Tags:
Dear Maintainer, The binfmt-support service fails to start, with the following output: systemd[1]: Starting Enable support for additional executable binary formats... update-binfmts[536]: update-binfmts: warning: unable to close /proc/sys/fs/binfmt_misc/register: File exists update-binfmts[536]: update-binfmts: warning: unable to close /proc/sys/fs/binfmt_misc/register: File exists update-binfmts[536]: update-binfmts: warning: unable to close /proc/sys/fs/binfmt_misc/register: File exists update-binfmts[536]: update-binfmts: exiting due to previous errors systemd[1]: binfmt-support.service: Main process exited, code=exited, status=2/INVALIDARGUMENT systemd[1]: binfmt-support.service: Failed with result 'exit-code'. systemd[1]: Failed to start Enable support for additional executable binary formats. Best, Facundo
Hi Facundo, 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) Afaics binfmt-support has remained a Debian-only solution, so long-term I'd think it would be beneficial if we'd consider systemd-binfmt as a cross-distro solution. There aren't that many packages installing config snippets in /usr/share/binfmts, so a transition seems reasonably doable. Colin, what's your take on this? Michael
Thanks for investigating that. I am not interested in this.
Am 01.06.22 um 13:18 schrieb Colin Watson: 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. This way, the condition is only evaluated when binfmt-support is actually installed. I've attached a possible patch for that. Colin, could you please review and if you agree, I'd re-assign this bug report back to binfmt-support. Michael
Am 02.06.22 um 11:16 schrieb Michael Biebl: 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
Control: tag -1 fixed-upstream Thanks, makes sense. I've pushed this patch upstream (https://gitlab.com/cjwatson/binfmt-support/-/commit/54f0e1af8a).
We believe that the bug you reported is fixed in the latest version of
binfmt-support, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1012154@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Colin Watson <cjwatson@debian.org> (supplier of updated binfmt-support package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Fri, 03 Jun 2022 00:45:44 +0100
Source: binfmt-support
Architecture: source
Version: 2.2.2-1
Distribution: unstable
Urgency: medium
Maintainer: Colin Watson <cjwatson@debian.org>
Changed-By: Colin Watson <cjwatson@debian.org>
Closes: 1012154
Changes:
binfmt-support (2.2.2-1) unstable; urgency=medium
.
* debian/upstream/metadata: Update for upstream move to GitLab.
* New upstream release.
- Run binfmt-support.service after systemd-binfmt.service (thanks,
Michael Biebl; closes: #1012154).
* Add Pre-Depends: ${misc:Pre-Depends}, since dh_installinit relies on
that for "invoke-rc.d --skip-systemd-native".
Checksums-Sha1:
b88965f6b4300b82ac16092a6cd78c438e72d4b9 2306 binfmt-support_2.2.2-1.dsc
6ef72f482b0ed0649ae27bbd3ea2601b2d1099c1 863480 binfmt-support_2.2.2.orig.tar.gz
c077e7ff54e2135c3a4f2090c43dce431134b0e5 833 binfmt-support_2.2.2.orig.tar.gz.asc
fc1dacfc17eb77c0ed1411d72d9c6dde8943480f 14836 binfmt-support_2.2.2-1.debian.tar.xz
Checksums-Sha256:
62a6ea70f2e6f20ff8cb5a15cdcd8f14931fd43900711d4bccdcc98542dc74b5 2306 binfmt-support_2.2.2-1.dsc
cce14163f9b526283e6f0d00f3be1cfe239fa2c7574e5e0ba8ad3db74166a4a5 863480 binfmt-support_2.2.2.orig.tar.gz
a905b3a7623cb7a93f2efa2ed2b0050b8dedf8f815b7f103f3486262b50fa72b 833 binfmt-support_2.2.2.orig.tar.gz.asc
41771fae6c69aa8bd1b86970a234a70543720ec4fbdcff78c591a52539b35f34 14836 binfmt-support_2.2.2-1.debian.tar.xz
Files:
42b20bc1de88040d4ae2cdda81dc91ca 2306 admin optional binfmt-support_2.2.2-1.dsc
97e366d9c6f68d8cd0ae5f47eb3c0735 863480 admin optional binfmt-support_2.2.2.orig.tar.gz
53bd10854e03970a4a98e6aff7bcfc85 833 admin optional binfmt-support_2.2.2.orig.tar.gz.asc
b7a7813e7d7b62a7680933f5a1d7e102 14836 admin optional binfmt-support_2.2.2-1.debian.tar.xz
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAmKZS8oACgkQOTWH2X2G
UAvpQg/7BmzI0Xz7flHmDRdwNHVKezoKf7zPhfHkTxgp/ukiXLdP+Mi0cUbX3KUU
kT4/tnJ0YluBT2F7F3/h/lE/NxACwvExaEXlp10vLwpnTuTzhlBUZcWwkAwvoet+
0ggpqSnanWCT34qhc3qffOJV7yFWn6hX6XLPl26OwCSJ+e9OhEuwiL6AH2gSUDsi
aCLIx9HNRtmt5v8W6LJdB97FAvACwdN80sirBACTIFX31IqjHrXm2WO4dCvfCqtf
275VIUBFWjyAkvg7Vgf3YOWCvdY9I6NNACV2gqRjz8VK4RoiHJ/N08PDQ0qEtnaC
GSqshD/aLLRfJ4MftO5UkwQJo8wk5WnLVBnqKuxyDCf9oMXyfSK+Lkc7CalxL8Dx
nnhKfoMYF6PkgQ6SDUTYWc+fDh0pNJk8iiBz09yHAzcAGIwnN3nplOm4jpaxro0v
QrRgXwKlWp2nQXFPzbNrsZ9DHziqEa+giGzFU54HjwIJsYz6PPiabIZ1QEpxccmO
0BTyz/IQh97+xR6+RTpm/tJt+xi0LYmq2xvXNNqidzwZ5WUMd38s/LRkAf6JSSxr
sI1Snk1eF1Sd7RhK8J1Raq2OWoDNz7hONh16uj5B3+D6KMZsspxDzTGEL+lqj42Q
PfKvfJmBTvWER6++/JYyOTBzUoteWhf84tVq6PmTykOQfUr9HbY=
=MD8R
-----END PGP SIGNATURE-----
Am 02.06.22 um 21:52 schrieb Colin Watson: Thank you, Colin!