-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(linux.net): DHCP server selection method #5578
Conversation
...g.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java
Show resolved
Hide resolved
...g.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java
Show resolved
Hide resolved
...g.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java
Outdated
Show resolved
Hide resolved
...g.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java
Outdated
Show resolved
Hide resolved
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
01fbd13
to
ff50d42
Compare
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
...g.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java
Outdated
Show resolved
Hide resolved
...g.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java
Outdated
Show resolved
Hide resolved
Tested on RPi and found the following issue. Starting point: in this setup When
|
...g.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java
Outdated
Show resolved
Hide resolved
...g.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java
Outdated
Show resolved
Hide resolved
Tested working on 3 different scenarios:
In scenario 1, Kura picked up
|
Exit code is 3 when |
3 is returned when |
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with the latest changes: when the condition described in #5578 (comment) verifies, we get the following error in the log:
2024-11-22T14:18:08,345 [pool-22-thread-1] ERROR o.e.k.l.n.d.s.DnsmasqTool - dnsmasq Systemd unit startup failed. Is dnsmasq package installed on the system?
which gives enough information for the user to fix this issue.
Therefore, given that the situation in which
- The user has
isc-dhcp-server
,dnsmasq
anddnsmasq-base
installed. - They remove
dnsmasq
without purging - Install kura
is quite unlikely and programmatically handling this situation brings diminishing returns, we accept current solution albeit not completely reliable.
We're planning to remove the support for isc-dhcp-server
in the near future and thus this issue should be even less relevant.
...eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/dhcp/server/DnsmasqTool.java
Outdated
Show resolved
Hide resolved
...g.eclipse.kura.linux.net/src/main/java/org/eclipse/kura/linux/net/util/LinuxNetworkUtil.java
Outdated
Show resolved
Hide resolved
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
This PR updates the method used to check if
dnsmasq
is available on the system.Related Issue: This PR fixes/closes N/A
Description of the solution adopted: Since the DHCP server manager uses the Systemd unit for
dnsmasq
, the method used to check the presence of the tool on the system has to check the existence of the unit and the command. This PR adds this check.The check runs this command:
systemctl status dnsmasq
. Then the exit code is checked, based on the official documentation. Since theDhcpServerManager
class uses a static method to check the tools, the method inLinuxNetworkUtil
has to be static too.This implies that the
CommandExecutorService
cannot be used since we haven't a reference to it. So, the method uses the standardProcessBuilder
class to run the command.I don't like it.
In addition to the test for this specific feature, this PR adds few test on the
getTool
method.