Bug#1129592: jarwrapper: Support binfmt_misc with systemd-binfmt

Kevin Locke kevin at kevinlocke.name
Tue Mar 3 17:18:21 GMT 2026


Package: jarwrapper
Version: 0.81
Severity: normal
Tags: patch

Dear Maintainer,

When systemd is installed, systemd-binfmts unregisters binfmt_misc
formats registered by update-binfmts (from the binfmt-support
package), including jarwrapper.  I reported this against systemd in
Bug 1127314.

Since that bug hasn't see any activity, I thought it might be worth
fixing from this end by adding systemd-binfmt support to jarwrapper.
This can be accomplished by installing the attached jarwrapper.binfmt
to /usr/lib/binfmt.d.  Note that it does not run jardetect, which
means that attempting to execute a jar file without
META-INF/MANIFEST.MF would cause

    Can't open /tmp/tmp.XXXXXXXXXX/META-INF/MANIFEST.MF: No such file or directory.
    Can't open /tmp/tmp.XXXXXXXXXX/META-INF/MANIFEST.MF: No such file or directory.
    Error: Invalid or corrupt jarfile /path/to/bad.jar

instead of

    invalid file (bad magic number): Exec format error

If this is unacceptable, we could consider alternative
implementations.

Once binfmt.d support is added, I believe `Depends: binfmt-support`
could also be relaxed to `Depends: binfmt-support | systemd` since
either can perform binfmt_misc registration.

Thanks for considering,
Kevin


-- System Information:
Debian Release: forky/sid
  APT prefers testing-debug
  APT policy: (990, 'testing-debug'), (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.19.0 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages jarwrapper depends on:
ii  binfmt-support  2.2.2-8
ii  fastjar         2:0.98-7

jarwrapper recommends no packages.

jarwrapper suggests no packages.

-- no debconf information
-------------- next part --------------
:jarwrapper:M::PK\x03\x04::/usr/bin/jarwrapper:


More information about the pkg-java-maintainers mailing list