Skip to content

Commit

Permalink
linstor: use relative hostname path
Browse files Browse the repository at this point in the history
As described in issue apache#8310 some older distributions don't have
hostname in /usr/bin so rely on PATH resolving
  • Loading branch information
rp- committed Feb 9, 2024
1 parent 56f0448 commit abb24a0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private String getLinstorRscName(String name) {

private String getHostname() {
// either there is already some function for that in the agent or a better way.
ProcessBuilder pb = new ProcessBuilder("/usr/bin/hostname");
ProcessBuilder pb = new ProcessBuilder("hostname");
try
{
String result;
Expand All @@ -88,7 +88,7 @@ private String getHostname() {
return result.trim();
} catch (IOException | InterruptedException exc) {
Thread.currentThread().interrupt();
throw new CloudRuntimeException("Unable to run '/usr/bin/hostname' command.");
throw new CloudRuntimeException("Unable to run 'hostname' command.");
}
}

Expand Down

0 comments on commit abb24a0

Please sign in to comment.