thin-edge / thin-edge.io

The open edge framework for lightweight IoT devices
https://thin-edge.io
Apache License 2.0
221 stars 54 forks source link

avoid explicit path to c8y-remote-access-plugin in operation definition #3111

Closed reubenmiller closed 1 month ago

reubenmiller commented 1 month ago

Is your feature improvement request related to a problem? Please describe.

The c8y_RemoteAccessConnect operation definition created via c8y-remote-access-plugin --init assumes the location of the binary is under /usr/bin/c8y-remote-access-plugin. When the c8y-remote-access-plugin is installed in a custom location, this results in a non-functional operation handler.

Below shows the generated operation file:

file: /etc/tedge/operations/c8y/c8y_RemoteAccessConnect

[exec]
command = "/usr/bin/c8y-remote-access-plugin"
topic = "c8y/s/ds"
on_message = "530"

Describe the solution you'd like

The exec.command field should not use a explicit path to the binary, and instead just use c8y-remote-access-plugin to allow the user to control the location via standard PATH environment variable.

For example, the following shows the desired result:

file: /etc/tedge/operations/c8y/c8y_RemoteAccessConnect

[exec]
command = "c8y-remote-access-plugin"
topic = "c8y/s/ds"
on_message = "530"

Describe alternatives you've considered

Technically the full path to the c8y-remote-access-plugin binary could be used at the time it is run, however this would not allow for the binaries to be relocated without having to re-run the c8y-remote-access-plugin --init command.

Additional context

reubenmiller commented 1 month ago

Implemented as described and an existing system test was extended to cover this ticket.

gligorisaev commented 1 month ago

Implemented as described and an existing system test was extended to cover this ticket.

I can only confirm