OCI entrypoint not treated as PID1

When launching an OCI container image, the configured entrypoint is not executed as process PID 1 inside the container namespace.
This causes failures when images require PID1 semantics, such as images using BusyBoxinit, which performs PID1 validation and refuses to start if not executed as PID 1.
Are there any workarounds for this at the moment? I’ve tried lxc.init.cmd = <init>with no luck, it seems incusd becomes PID 1 regardless.

What’s your current entrypoint?

/usr/bin/init (busybox)

in the case of busybox init I can get around it by invoking linuxrc instead of init and that will skip PID 1 enforcement (unsure of side effects):

/* Expect to be invoked as init with PID=1 or be invoked as linuxrc */
if (getpid() != 1
 && (!ENABLE_LINUXRC || applet_name[0] != 'l') /* not linuxrc? */
) {
        bb_simple_error_msg_and_die("must be run as PID 1");
}
1 Like