From 0e45dbe4db4a9fec852983c85d3ada66f09ceb41 Mon Sep 17 00:00:00 2001 From: Isaac Beckman Date: Sun, 17 Jul 2016 17:42:03 +0300 Subject: [PATCH] Execute source before running non-interactive ssh The SSH command execution shell is a non-interactive shell. The commands from the file /etc/profile are executed only when bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option. Hence need to source /etc/profile explicitly Change-Id: I88560431e7e14b70ccc1cdab77b218036b586f96 --- provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh b/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh index 5a532af..c9f3645 100644 --- a/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh +++ b/provisioning_scripts/fibre_channel/invoke_fc_passthrough.sh @@ -119,7 +119,7 @@ fi echo "Found Hypervisor hostname: $HYPERVISOR" fc_pci_device_cmd="echo \$$FC_PCI_VAR_NAME" -fc_pci_device=$(ssh -i $PROVIDER_KEY $PROVIDER_USER@$HYPERVISOR "$fc_pci_device_cmd") +fc_pci_device=$(ssh -i $PROVIDER_KEY $PROVIDER_USER@$HYPERVISOR "source /etc/profile; $fc_pci_device_cmd") if [[ -z $fc_pci_device ]]; then echo "No FC device known. Set fc_pci_device in your /etc/profile.d or /etc/environment (depending on distro and ssh configuration) to the desired 'Class Device path', e.g. '0000:21:00.2'"