jpetazzo / pipework

Software-Defined Networking tools for LXC (LinuX Containers)
Apache License 2.0
4.22k stars 727 forks source link

/sys/fs seems to prefix container with "docker-" causing find mismatch #187

Closed h6w closed 4 years ago

h6w commented 8 years ago

On my Ubuntu 15.10 system, the /sys/fs/cgroup/devices contains, for example:

/sys/fs/cgroup/devices/system.slice/docker-d61b60e384fae452698ae92c7111b2501042a8bf89fb247cf759338a387c724a.scope/tasks

However, https://github.com/jpetazzo/pipework/blob/master/pipework#L225 calls:

find "$CGROUPMNT" -name "$GUESTNAME*"

where GUESTNAME is the container ID.

This results in a mismatch, and the error:

head: cannot open ‘/tasks’ for reading: No such file or directory

I tried prefixing $GUESTNAME with 'docker-' and it worked ok, but this isn't a general solution.

jpetazzo commented 8 years ago

Do you still have that issue? The code uses Docker to look up the container, so this code shouldn't be called if you have Docker and are using pipework on a Docker container... Unless I'm missing something :)