jpetazzo / pipework

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

it is an alternative way to get the pid #158

Closed spheresh closed 9 years ago

spheresh commented 9 years ago

Some times /sys/fs/cgroup/devices/lxc/{GUESTNAME}/tasks file is empty so this part of code doesn't work correct

NSPID=$(head -n 1 "$(find "$CGROUPMNT" -name "$GUESTNAME" | head -n 1)/tasks")

and it causes the errors like this:

Could not find a process inside container {GUESTNAME}.

or

There was an error executing ["sudo", "/usr/local/bin/vagrant-lxc-wrapper", "pipework", "vlxcbr0", "{GUESTNAME}", "192.168.2.104/24"]

I don't sure which is the root cause of the problem, but this approach works for me

jpetazzo commented 9 years ago

LGTM. Thank you!