eclipse-kura / kura

Eclipse Kura™ is a versatile framework to supercharge your edge devices, streamlining the process of configuring your gateway, connecting sensors, and IoT devices to seamlessly collect, process, and send data to the cloud.
https://eclipse.dev/kura/
Eclipse Public License 2.0
499 stars 306 forks source link

LinuxNetworkUtil#toolExists() should check for tool's existence in PATH #235

Closed kartben closed 10 months ago

kartben commented 8 years ago

I recently ported Kura to a target that has no ethtool, etc. out-of-the-box so I had to compile those manually and put them on my filesystem. Since /sbin, /usr/sbin etc. are on read-only partition, I ended up putting the executables in ~/bin. However, LinuxNetworkUtil#toolExists() only checks for the tool's existence in "/sbin/", "/usr/sbin/" and "/bin/" (while later on, it doesn't really matter where the tool really is since ProcessUtil.exec() will look for it in the PATH). See https://github.com/eclipse/kura/blob/063bc48d3c860182a821a6691e51b4bb71e4510b/kura/org.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java#L326 I had to "hack" the methods so as it would look for the tool in my folder.

I would suggest toolExists() is updated to look for the tool's existence in the PATH.

cdealti commented 8 years ago

@kartben I believe we should externalize this stuff in configuration files, e.g. in kura.properties

kura.os.prog.chmod=/bin/chmod
kartben commented 8 years ago

+1. However, I think the properties file may need some love at some point, right now it is sometimes hard to figure out which file defines which properties and/or what some properties are used for. See e.g kura.properties:

kura.project=raspberry-pi
kura.platform=Raspberry-Pi
kura.device.name=Raspberry-Pi
kura.model.id=Raspberry-Pi
kura.model.name=Raspberry-Pi
kura.partNumber=Raspberry-Pi
kura.serialNumber=Raspberry-Pi

At first glance, it's hard to see what should/could be the difference between e.g kura.platform, kura.device.name and kura.model.name.

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] commented 10 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.