Closed reubenmiller closed 1 month ago
After further investigating, it seems that the problem was introduced in https://github.com/thin-edge/thin-edge.io/pull/2888, and affects Linux (not MacOS).
let exec_path: std::path::PathBuf = std::env::current_exe()
.into_diagnostic()
.with_context(|| "Could not get current process executable")?;
The problem occurs on Linux as the current_exe()
result returns the underlying tedge
binary and not the symlink that was used to launch c8y-remote-access-plugin
. Find tedge
is then unexpected when launching another instance of c8y-remote-access-plugin
as it calls tedge
and not the subcommand in the multi-call binary setup.
The Rust docs for current_exe has a note that the implementation is OS specific, so it seems that Linux will follow symlinks, where-as MacOS does not.
QA has tested the bug and it's not reproducable anymore
Describe the bug
Calling the
c8y-remote-access-plugin
without the--child
argument returns a non-zero exit code with an error message.For example
This is a problem because the default c8y_RemoteAccessConnect operation handler calls c8y-remote-access-plugin as above.
file: /etc/tedge/operations/c8y/c8y_RemoteAccessConnect
To Reproduce
When the bug is present, the Cumulocity IoT remote access operation will fail with the following reason:
Expected behavior
Screenshots
Environment (please complete the following information):
Poky (Yocto Project Reference Distro) 4.0.18 (kirkstone)
Raspberry Pi 4 Model B Rev 1.5
Linux rpi4-d83add90fe56 5.15.92-v8 #1 SMP PREEMPT Wed Feb 8 16:47:50 UTC 2023 aarch64 GNU/Linux
tedge 1.0.2~319+g2b3e3ea
Additional context