From abb24a09671c15413606dd0904923a57294e7037 Mon Sep 17 00:00:00 2001 From: Rene Peinthor Date: Fri, 9 Feb 2024 05:52:22 +0100 Subject: [PATCH] linstor: use relative hostname path As described in issue #8310 some older distributions don't have hostname in /usr/bin so rely on PATH resolving --- .../cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java b/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java index 426145d9dcc5..87746447188d 100644 --- a/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java +++ b/plugins/storage/volume/linstor/src/main/java/com/cloud/hypervisor/kvm/storage/LinstorStorageAdaptor.java @@ -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; @@ -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."); } }