containers / conmon-rs

An OCI container runtime monitor written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't run conmon-rs with cargo run

kangclzjc opened this issue · comments

What happened?

Hi, when I want to run this project with cargo run, it failed, even if I specific --bin like below:

cargo run --bin=/home/zk/go/src/github.com/containers/conmon-rs/target/debug

It get this error :
error: no bin target named /home/zk/go/src/github.com/containers/conmon-rs/target/debug/conmonrs

What did you expect to happen?

Run successfully

How can we reproduce it (as minimally and precisely as possible)?

cd containers/conmon-rs
cargo run --bin=/home/zk/go/src/github.com/containers/conmon-rs/target/debug

Anything else we need to know?

No response

conmon-rs version

$ conmonrs --version
# paste output here

OS version

# On Linux:
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

$ uname -a
inux ubuntu 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Additional environment details (AWS, VirtualBox, physical, etc.)

@kangclzjc thank you for opening this request!

Does this work for you:

> cargo run --bin conmonrs -- -h
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
     Running `target/debug/conmonrs -h`
conmon
An OCI container runtime monitor

USAGE:
    conmonrs [OPTIONS] --runtime <RUNTIME> --runtime-dir <RUNTIME_DIR>

OPTIONS:
    -d, --log-driver <DRIVER>            The logging driver used by the conmon server [env: CONMON_LOG_DRIVER=] [default: systemd] [possible values: stdout, systemd]
    -h, --help                           Print help information
    -l, --log-level <LEVEL>              The logging level of the conmon server [env: CONMON_LOG_LEVEL=] [default: info] [possible values: trace, debug, info, warn, error, off]
    -r, --runtime <RUNTIME>              Binary path of the OCI runtime to use to operate on the containers [env: CONMON_RUNTIME=]
        --runtime-dir <RUNTIME_DIR>      Path of the directory for conmonrs to hold files at runtime [env: CONMON_RUNTIME_DIR=]
        --runtime-root <RUNTIME_ROOT>    Root directory used by the OCI runtime to operate on containers [env: CONMON_RUNTIME_ROOT=]
        --skip-fork <SKIP_FORK>          Do not fork if true [env: CONMON_SKIP_FORK=]
    -v, --version                        Show version information

@saschagrunert yeah, thank you help help. I run command like thie:

sudo /root/.cargo/bin/cargo run --color=always --target-dir=/home/zk/go/src/github.com/containers/conmon-rs/target --bin=conmonrs -- --runtime=/usr/sbin/runc --runtime-dir ./
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `target/debug/conmonrs --runtime=/usr/sbin/runc --runtime-dir ./`

It works now.