524 fix aufs links related warnings #816

Merged
merged 5 commits into from Jun 14, 2013

Conversation

Projects
None yet
4 participants
@unclejack
Contributor

unclejack commented Jun 4, 2013

This PR fixes #524.

The first commit modifies mount.go so that we try to run auplink before unmounting the aufs layers. If docker fails to run auplink, it will print a warning and move on.
The warning looks something along these lines:
[warning]: couldn't run auplink before unmount: couldn't find auplink in $PATH

The second commit adds aufs-tools to the list of dependencies for the installation of lxc-docker on Ubuntu and Debian.

auplink makes sure that hard links across layers are handled properly upon unmount.

@creack Please take a look at this PR.

@unclejack

This comment has been minimized.

Show comment Hide comment
@unclejack

unclejack Jun 4, 2013

Contributor

I've updated the PR after running go fmt.

Contributor

unclejack commented Jun 4, 2013

I've updated the PR after running go fmt.

@ghost ghost assigned jpetazzo Jun 4, 2013

@creack

This comment has been minimized.

Show comment Hide comment
@creack

creack Jun 4, 2013

Contributor

@jpetazzo Can you take a look at this?

Contributor

creack commented Jun 4, 2013

@jpetazzo Can you take a look at this?

@unclejack

This comment has been minimized.

Show comment Hide comment
@unclejack

unclejack Jun 6, 2013

Contributor

Here are some steps to reproduce this:

sudo apt-get install aufs-tools
# tag1
docker run -i -t ubuntu bash
ln -P /bin/bash /tmp/bash

# on the host:
cat /proc/mounts | grep aufs
# tag2
# use id from mounts
auplink <path> list
# it should look like this:
auplink /var/lib/docker/containers/d35ee0ee3d5bbbd1b89497501607808b1ea9e0e58ac3c56cd924abf7ffcb7b5d/rootfs list
45 
/var/lib/docker/containers/d35ee0ee3d5bbbd1b89497501607808b1ea9e0e58ac3c56cd924abf7ffcb7b5d/rootfs/tmp/bash
/var/lib/docker/containers/d35ee0ee3d5bbbd1b89497501607808b1ea9e0e58ac3c56cd924abf7ffcb7b5d/rootfs/bin/bash

# switch back to the terminal emulator where the container is running bash
exit
dmesg | grep aufs
# there should be one or more entries like this
[ 8699.025792] aufs au_plink_put:442:docker[8238]: pseudo-link is not flushed
[ 8829.270773] aufs au_plink_put:442:docker[8242]: pseudo-link is not flushed

# repeat the steps between tag1 and tag2
# flush
auplink <path> flush
dmesg | grep aufs
# there should be no new entries like the ones seen before

Even though this is rarely encountered, it's a good idea to handle these cases. I don't recall creating any links (of any kind) back when I've run into this problem with the logged warnings listed in #524

Contributor

unclejack commented Jun 6, 2013

Here are some steps to reproduce this:

sudo apt-get install aufs-tools
# tag1
docker run -i -t ubuntu bash
ln -P /bin/bash /tmp/bash

# on the host:
cat /proc/mounts | grep aufs
# tag2
# use id from mounts
auplink <path> list
# it should look like this:
auplink /var/lib/docker/containers/d35ee0ee3d5bbbd1b89497501607808b1ea9e0e58ac3c56cd924abf7ffcb7b5d/rootfs list
45 
/var/lib/docker/containers/d35ee0ee3d5bbbd1b89497501607808b1ea9e0e58ac3c56cd924abf7ffcb7b5d/rootfs/tmp/bash
/var/lib/docker/containers/d35ee0ee3d5bbbd1b89497501607808b1ea9e0e58ac3c56cd924abf7ffcb7b5d/rootfs/bin/bash

# switch back to the terminal emulator where the container is running bash
exit
dmesg | grep aufs
# there should be one or more entries like this
[ 8699.025792] aufs au_plink_put:442:docker[8238]: pseudo-link is not flushed
[ 8829.270773] aufs au_plink_put:442:docker[8242]: pseudo-link is not flushed

# repeat the steps between tag1 and tag2
# flush
auplink <path> flush
dmesg | grep aufs
# there should be no new entries like the ones seen before

Even though this is rarely encountered, it's a good idea to handle these cases. I don't recall creating any links (of any kind) back when I've run into this problem with the logged warnings listed in #524

@jpetazzo

This comment has been minimized.

Show comment Hide comment
@jpetazzo

jpetazzo Jun 10, 2013

Contributor

LGTM. (And sorry for the lag!)

Contributor

jpetazzo commented Jun 10, 2013

LGTM. (And sorry for the lag!)

@creack

This comment has been minimized.

Show comment Hide comment
@creack

creack Jun 12, 2013

Contributor

LGTM, it adds a dependency but it helps prevent AUFS issues

Contributor

creack commented Jun 12, 2013

LGTM, it adds a dependency but it helps prevent AUFS issues

@vieux

This comment has been minimized.

Show comment Hide comment
@vieux

vieux Jun 14, 2013

Collaborator

LGTM, we should probably update the Vagrantfile and the "Set up a Dev Environment" doc as well.

Collaborator

vieux commented Jun 14, 2013

LGTM, we should probably update the Vagrantfile and the "Set up a Dev Environment" doc as well.

@unclejack

This comment has been minimized.

Show comment Hide comment
@unclejack

unclejack Jun 14, 2013

Contributor

I've added the aufs-tools package to the "setting up a development environment" page.
I've also added the aufs-tools package to the testing and hack vagrant boxes. The other vagrant boxes should install it automatically because of the lxc-docker dependency.

@mzdaniel Can you take a look, please?

Contributor

unclejack commented Jun 14, 2013

I've added the aufs-tools package to the "setting up a development environment" page.
I've also added the aufs-tools package to the testing and hack vagrant boxes. The other vagrant boxes should install it automatically because of the lxc-docker dependency.

@mzdaniel Can you take a look, please?

@unclejack

This comment has been minimized.

Show comment Hide comment
@unclejack

unclejack Jun 14, 2013

Contributor

Just as a further explanation, here are the details concerning how all the boxes will be getting aufs-tools:

manually installed via apt-get:
./hack/Vagrantfile
./testing/Vagrantfile

automatically installed as a dependency of the lxc-docker package:
./packaging/debian/Vagrantfile
./packaging/ubuntu/Vagrantfile
./Vagrantfile

The Ubuntu box used by the Vagrantfile of each of the Ubuntu vagrant VMs is able to install aufs-tools. The debian box is also able to install it without problems by default.

Contributor

unclejack commented Jun 14, 2013

Just as a further explanation, here are the details concerning how all the boxes will be getting aufs-tools:

manually installed via apt-get:
./hack/Vagrantfile
./testing/Vagrantfile

automatically installed as a dependency of the lxc-docker package:
./packaging/debian/Vagrantfile
./packaging/ubuntu/Vagrantfile
./Vagrantfile

The Ubuntu box used by the Vagrantfile of each of the Ubuntu vagrant VMs is able to install aufs-tools. The debian box is also able to install it without problems by default.

@creack

This comment has been minimized.

Show comment Hide comment
@creack

creack Jun 14, 2013

Contributor

@unclejack could you rebase to master?

Contributor

creack commented Jun 14, 2013

@unclejack could you rebase to master?

@unclejack

This comment has been minimized.

Show comment Hide comment
@unclejack

unclejack Jun 14, 2013

Contributor

@creack I've rebased it to master, please feel free to check it out.

Contributor

unclejack commented Jun 14, 2013

@creack I've rebased it to master, please feel free to check it out.

creack added a commit that referenced this pull request Jun 14, 2013

Merge pull request #816 from unclejack/524-fix_aufs_links_related_war…
…nings

524 fix aufs links related warnings

@creack creack merged commit 4a02c6d into moby:master Jun 14, 2013

@unclejack unclejack deleted the unclejack:524-fix_aufs_links_related_warnings branch Jun 14, 2013

@petrosagg petrosagg referenced this pull request in resin-os/balena Nov 27, 2017

Closed

Couldn't run auplink before unmount #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment