lxc-rs icon indicating copy to clipboard operation
lxc-rs copied to clipboard

Attach/run_command example?

Open andrenth opened this issue 6 years ago • 2 comments

Hi

Do you have an example of how to use lxc::attach::run_command(), specifically how to build the payload argument?

Thanks.

andrenth avatar Jun 21 '18 18:06 andrenth

According to the C API documentation, the payload argument is a lxc_attach_command_t.

As I can see in some code, this function should be use via container->attach (and probably shouldn’t be public). If you have a small C example, that can accelerate my undestand of this point.

sanpii avatar Jun 21 '18 19:06 sanpii

Well, I understand how this function work!

I write an example: https://github.com/sanpii/lxc-rs/blob/attach/examples/attach.rs

It’s compile but doesn’t work:

Error { num: 1, str: "" }

sanpii avatar Sep 26 '21 19:09 sanpii