-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Delivery/PackagingRPM and deb packaging, tar and zip archives, shell and batch scriptsRPM and deb packaging, tar and zip archives, shell and batch scripts>bugTeam:DeliveryMeta label for Delivery teamMeta label for Delivery teamblockerv7.0.0-rc2
Description
In https://github.com/elastic/elasticsearch/blob/master/distribution/src/bin/elasticsearch-cli,
when we
source "`dirname "$0"`"/elasticsearch-env
we cd in $ES_HOME changing the pwd. However, the dirname commands in the following
for additional_source in "${additional_sources[@]}"
do
source "`dirname "$0"`"/$additional_source
done
will have an output that is always relevant to the current dir from where the user ran the cli command.
The combination of these two mean, that the source command will try to source a file, the path of which will be the concatenation of $ES_HOME and the dir from where the user ran the cli command. This will only work when the user runs the command from $ES_HOME. Example output from @pheyos who raised this:
robert@elastic-ro:~/es_versions/700_bc1/elasticsearch-7.0.0/bin$ ./elasticsearch-setup-passwords interactive
./elasticsearch-cli: line 10: ./x-pack-env: No such file or directory
./elasticsearch-cli: line 10: ./x-pack-env: No such file or directory is because the pwd at that time is $ES_HOME and not $ES_HOME/bin
Metadata
Metadata
Assignees
Labels
:Delivery/PackagingRPM and deb packaging, tar and zip archives, shell and batch scriptsRPM and deb packaging, tar and zip archives, shell and batch scripts>bugTeam:DeliveryMeta label for Delivery teamMeta label for Delivery teamblockerv7.0.0-rc2