Red Hat Bugzilla – Bug 1026814
libvirt-lxc leaks /.oldroot directory in container FS
Last modified: 2014-06-09 05:14:09 EDT
Description of problem:
libvirt-lxc creates an /.oldroot directory in the container filesystem and never removes it before executing the container application.
Version-Release number of selected component (if applicable):
Start a container
Steps to Reproduce:
$ virt-sandbox -c lxc:/// /bin/bash
bash: /root/.bashrc: Permission denied
bash-4.2# ls -ald /.oldroot
drwxr-xr-x. 2 root root 4096 Aug 13 13:56 /.oldroot
The /.oldroot directory exists.
The /.oldroot directory should not exist.
I was able to reproduce this on Fedora 20. Containers are getting a directory /.oldroot created when being started from virt-manager or virsh start.
The .oldroot directory is required during the pivot_root to setup the isolated filesystems. We can't remove it in a race free manner because there can be multiple containers starting in parallel using the same root filesystem. Merely having this directory exist should not cause any functional problems.