lxc-attach prints warning: Invalid argument - Unsupported config key "lxc.seccomp"
Summary:
Every time we run lxc-attach -n 0 on our system (0 is the name of the container), we get:
... Unsupported config key "lxc.seccomp".
Required information
- Distribution: Debian
- Distribution version: Bookworm
- Lxc version: lxc_5.0.2-1+deb12u2
Issue description
Every time we run "lxc-attach -n 0" on our system (0 is the name of the container), we get the warning message:
lxc-attach: 0: ../../src/lxc/confile.c: set_config_unsupported_key: 164 Invalid argument - Unsupported config key "lxc.seccomp".
Container '0' has a config file created from a template. That template doesn't have any 'seccomp' related options in it, and we don't compile it with seccomp support.
But it seems like it doesn't matter to the src/lxc/attach.c code, because it seems to check regardless of whether seccomp is supported/compiled in:
if (!fetch_seccomp(ctx->container, options))
WARN("Failed to get seccomp policy");
This code is always called near the beginning of the function int lxc_attach(). Should this warning be masked if the user does not intend on using seccomp and/or doesn't have it compiled in?
PS: I managed to suppress the warning message with an ifdef wrapper.
I'm not sure if this is the correct way to do it.
#if HAVE_SECCOMP
if (!fetch_seccomp(ctx->container, options))
WARN("Failed to get seccomp policy");
#endif
Could I be assigned this issue? I will try the ifdef wrapper solution (and I will make sure it does not affect other distros).
I’ll also investigate other solutions, as lxc-attach has seemed to be working in other distos like alpine
@gideonda1 could you send the config file you used to create this container?