zombie process after (attach and run_command)
fanyeren opened this issue · 3 comments
fanyeren commented
require 'lxc'
c = LXC::Container.new('foo')
c.create('ubuntu')
c.start
c.attach do
LXC.run_command('/sbin/ifconfig')
end
c.stop
c.destroy
after i execute this script,i found ifconfig process become a zombie process
fanyeren commented
zombie process after (attach and run_command)
fanyeren commented
i've tried
pid = c.attach do
LXC.run_command('/sbin/ifconfig')
end
Process.wait(pid)
and this problem is fixed
andrenth commented
You can also call
c.attach(wait: true) do
...
end
# No Process.wait needed
I'm considering switching the wait
flag to default to true, but that would be only for 2.0.0.