Weird snap automount.

Soldato
Joined
16 Sep 2018
Posts
12,659
On my learning Linux adventure I've come across a why is it doing that situation, i always think it's a good idea to familiarise yourself with an OS so you know what's normal and what's not, going through various logs and tweaking/playing around with things I've learnt a lot.

However snap being snap this one has left me at a dead-end, my Google-fu must be letting me down so I'm hoping someone maybe able to point me in the right direction, I'm not necessarily wanting to know how to fix this as it's not causing any issues but it would be nice to know why or how it's happening. Essentially journald is being spammed with the following...
Code:
systemd    proc-sys-fs-binfmt_misc.automount: Got automount request for /proc/sys/fs/binfmt_misc, triggered by 508 (snap)
systemd    proc-sys-fs-binfmt_misc.automount: Automount point already active?
The triggered by number will change after 20-30 entries but essentially journald gets spammed with 100 odd such entries, i know snap automounts snap images but AFAIK it shouldn't be trying to automount things 100 odd times.

So anyone got any idea why it's making so many request to binfmt_misc?
 
Last edited:
Soldato
OP
Joined
16 Sep 2018
Posts
12,659
Other than the basic snaps that came with Kubuntu none, i replaced the Firefox Snap for the deb version because like a lot of people i don't like snaps. I'm not much for containerised packages at all if I'm honest, however I've kept the basic Snap infrastructure in place because i want to avoid any potential problems down the road when it comes to upgrading to the next LTS.

The bottom line is I've masked the proc-sys-fs-binfmt_misc.automount service so it's not spamming the logs any more but I'd still like to try understanding a little more about why or what's causing snap to attempt so many mounts. I had already read that Reddit post and it helped to understand a bit more but i still don't really understand why snap would be doing that or even why you'd mount something simply to recognise a different binary format on the CLI.
 
Soldato
OP
Joined
16 Sep 2018
Posts
12,659
From my understanding and going on the kernel documents, like you I'm not 100%, it's used for a proc mount.
It seems to be used for interpreting unknown binary formats into something Linux knows what to do with, so if you had something like a .com or .exe it would know to open those in Wine or whatever.

The Arch wiki shows how it works with Java but the principal is the same for other file types...

I have my suspicion that snap is remounting the root FS read only, as it does to containerise snaps, but for some reason when it does that it's trying to either remount the original /proc/sys/fs/binfmt_misc or trying to mount the /proc/sys/fs/binfmt_misc in the read only version of what it mounted.

Either way the only thing binfmt-misc is doing is setting up interpretation for Python so i guess I'll see how it goes. :)
 
Back
Top Bottom