Remount lxcfs inside running container

Hi there!

Just a bit of context, I use LXC in production system for long-running apps (java apps, databases, searchDB, …) so I have containers with pretty big uptimes (200 days +) and I only use lxc (via saltstack management framework) and lxcfs

Right now, when I compile a new lxcfs version and do a service lxcfs restart, lxcfs mounts in the containers vanishes

The question is basically, how can I replay the lxcfs mount hook but on a running container ?


It’s very difficult to do so as the kernel normally prevents adding new cross-namespace bind-mounts.

That’s why LXCFS was designed to not need restarting in the first place.
The main lxcfs binary is only a very small, generic loader. The main code is inside a shared library which lxcfs loads and calls the various endpoints from.

When sent SIGUSR1 lxcfs will reload that library and then keep going. That’s how we “upgrade” lxcfs in the Debian/Ubuntu packages. The main binary itself is never reloaded but the rest of the code is.