Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proc-sys-fs-binfmt_misc.mount #574

Closed
tomberek opened this issue Dec 17, 2016 · 15 comments · Fixed by NixOS/nixpkgs#87742
Closed

proc-sys-fs-binfmt_misc.mount #574

tomberek opened this issue Dec 17, 2016 · 15 comments · Fixed by NixOS/nixpkgs#87742
Labels

Comments

@tomberek
Copy link
Contributor

I've noticed this on my own deployments and in other comments and dicsussions #465 and #391.

proc-sys-fs-binfmt_misc.mount [failed]

A manual restart clears the error.

@domenkozar domenkozar added the bug label Dec 22, 2016
@greglearns
Copy link

+1 still exists

@andrewchambers
Copy link

getting this in my virtual box tests.

@kolloch
Copy link

kolloch commented Feb 2, 2018

It might be detected incorrectly as an error. It also happens on my machine that I have not setup with nixos:

$ systemctl status proc-sys-fs-binfmt_misc.mount
● proc-sys-fs-binfmt_misc.mount - Arbitrary Executable File Formats File System
   Loaded: loaded (/nix/store/vb5k2bvs7ralcnpw4kxwf9qmsmqq4xri-systemd-234/example/systemd/system/proc-sys-fs-binfmt_misc.mount; linked; vendor preset: enabled)
   Active: inactive (dead)
    Where: /proc/sys/fs/binfmt_misc
     What: binfmt_misc
     Docs: https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html
           https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems

Furthermore, on all the affected machines I see the following mount, so it seems to have an effect (or something else):

systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,...)

That said, other mount units look different:

# systemctl status sys-kernel-debug.mount
● sys-kernel-debug.mount - Kernel Debug File System
   Loaded: loaded (/nix/store/vb5k2bvs7ralcnpw4kxwf9qmsmqq4xri-systemd-234/example/systemd/system/sys-kernel-debug.mount; enabled; vendor preset: enab
   Active: active (mounted) since Wed 2018-01-24 20:47:22 UTC; 1 weeks 1 days ago
    Where: /sys/kernel/debug
     What: debugfs
     Docs: https://www.kernel.org/doc/Documentation/filesystems/debugfs.txt
           https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/sys-kernel-debug.mount

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

@kolloch
Copy link

kolloch commented Feb 2, 2018

Aaah, I understood a bit more about this. There is an accompanying proc-sys-fs-binfmt_misc.automount unit which cause the mount I mention before. If you execute cd /proc/sys/fs/binfmt_misc/, the automount is activated and the systemd unit becomes "active":

● proc-sys-fs-binfmt_misc.mount - Arbitrary Executable File Formats File System
   Loaded: loaded (/nix/store/vb5k2bvs7ralcnpw4kxwf9qmsmqq4xri-systemd-234/example/systemd/system/proc-sys-fs-binfmt_misc.mount; linked; vendor preset: enabled)
   Active: active (mounted) since Fri 2018-02-02 07:32:36 UTC; 2min 12s ago
    Where: /proc/sys/fs/binfmt_misc
     What: binfmt_misc
     Docs: https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html
           https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
  Process: 1483 ExecMount=/nix/store/yizg9cg4x6xbyhz4h2w9qklql85m5xkx-util-linux-2.31-bin/bin/mount binfmt_misc /proc/sys/fs/binfmt_misc -t binfmt_misc (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/proc-sys-fs-binfmt_misc.mount

Feb 02 07:32:36 webserver systemd[1]: Mounting Arbitrary Executable File Formats File System...
Feb 02 07:32:36 webserver systemd[1]: Mounted Arbitrary Executable File Formats File System.

@devhell
Copy link

devhell commented Nov 20, 2018

So, this doesn't look like it's affecting anything negatively, it is rather annoying though to see that in nixops check outputs. Is there a sensible solution to this?

@tomberek
Copy link
Contributor Author

tomberek commented Dec 1, 2018

@devhell This removes the error, but it's not very satisfying, not sure what the right solution is:

  boot.binfmtMiscRegistrations = {
    dummy = {
      mask = "00000";
      recognitionType = "magic";
      magicOrExtension = "never";
      interpreter = /bin/sh;
    };
  };

@matthewbauer
Copy link
Member

I think you can avoid that altogether with this:

systemd.additionalUpstreamSystemUnits =
      [ "proc-sys-fs-binfmt_misc.automount"
        "proc-sys-fs-binfmt_misc.mount"
      ];

This looks like a fairly common systemd error. Might be worthwhile to open an issue there.

@kirelagin
Copy link
Member

The weird thing is that # systemctl list-units | grep binfmt returns nothing for me and systemctl status is all green with:

    State: running
     Jobs: 0 queued
   Failed: 0 units

so why does nixops report this unit as failed if it doesn’t even exist?

@kirelagin
Copy link
Member

kirelagin commented Jan 17, 2019

Ohhh ok, so nixops does this:

# systemctl --all | grep not-found
● proc-sys-fs-binfmt_misc.automount                                           not-found inactive dead      proc-sys-fs-binfmt_misc.automount
● proc-sys-fs-binfmt_misc.mount                                               not-found inactive dead      proc-sys-fs-binfmt_misc.mount
● tmp.mount                                                                   not-found inactive dead      tmp.mount
● auditd.service                                                              not-found inactive dead      auditd.service
● display-manager.service                                                     not-found inactive dead      display-manager.service
● emergency.service                                                           not-found inactive dead      emergency.service
● plymouth-start.service                                                      not-found inactive dead      plymouth-start.service
● syslog.service                                                              not-found inactive dead      syslog.service
● systemd-hwdb-update.service                                                 not-found inactive dead      systemd-hwdb-update.service
● systemd-sysusers.service                                                    not-found inactive dead      systemd-sysusers.service
● cryptsetup.target                                                           not-found inactive dead      cryptsetup.target
● emergency.target                                                            not-found inactive dead      emergency.target
● initrd-switch-root.target                                                   not-found inactive dead      initrd-switch-root.target

Then ignores everything which is not a .mount and then filters out everything in /tmp, in /sys, or in /dev, but our patient is in /proc/sys. Should we just add an exception for /proc or /proc/sys?

@lordcirth
Copy link

Filtering out /proc here seems reasonable to me. Can anyone think of a case where that would be undesirable?

@datafoo
Copy link

datafoo commented May 12, 2020

May be related to: NixOS/nixpkgs#87687

@flokli
Copy link
Contributor

flokli commented May 13, 2020

possible fix: NixOS/nixpkgs#87742

flokli added a commit to flokli/nixpkgs that referenced this issue May 18, 2020
Also, remove the dangling systemd.services.systemd-binfmt.wants = [
"proc-sys-fs-binfmt_misc.mount" ]; in systemd.nix.

If boot.binfmt.registrations != {}, systemd will install
proc-sys-fs-binfmt_misc.automount, which will auto-mount
`/proc/sys/fs/binfmt_misc` as soon as systemd-binfmt tries to access it.

Fixes NixOS#87687
Fixes NixOS/nixops#574
@flokli
Copy link
Contributor

flokli commented May 18, 2020

@grahamc with NixOS/nixpkgs#87742 closed, can you close this too?

@adisbladis
Copy link
Member

Fixed in nixpkgs, closing!

@Xe
Copy link

Xe commented Jun 23, 2021

This is still happening for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.