[systemd-devel] [PATCH] nspawn: Fix a race condition

Lennart Poettering lennart at poettering.net
Mon Mar 10 13:43:13 PDT 2014


On Mon, 10.03.14 12:15, Joel Teichroeb (joel at teichroeb.net) wrote:

> If the master process registers the child before the child
> has initialized, when the child tries to setup /dev/console
> it gets "operation not permitted".

Thanks for tracking this down!

I have now applied a different patch which uses /dev/null as source for
the major/minor to use. Given that the code in question simply needs to
create a valid device node to bind mount over, the actual major/minor
used for it doesn't matter. Since creating additional /dev/null
instances in the container (in contrast to creating additional
/dev/console instances) is permitted anyway, this should be a safe thing
to do, and doesn't require additional syncronization between the
container and nspawn.

Please check if this works for you!

Thanks,

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list