Skip to content
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

Fix scripts invocation #1077

Merged
merged 1 commit into from
Jun 14, 2019
Merged

Fix scripts invocation #1077

merged 1 commit into from
Jun 14, 2019

Conversation

david-kow
Copy link
Contributor

Three issues being fixed here:

  1. 'bash -c string' reads commands from string and interprets them. There is no call to execve as there is no file. This means that shebang gets ignored as a comment.
  2. shebang contains path to env, bash and bash_arguments, but handling of the arguments differ. On OSX it will pass arguments correctly (and run '/usr/bin/env bash -eu'), but on centos it will try to call '/usr/bin/env "bash bash_arguments"' which will fail.
  3. '#!' have to be first two characters.

Shebang is kept in the script body, so its runnable even if invoked differently. Current invocation of the script is changed to go via env directly.

Three issues being fixed here:
1. 'bash -c string' reads commands from string and interprets them. There is no
call to execve as there is no file. This means that shebang gets ignored as a
comment.
2. shebang contains path to env, bash and bash_arguments, but handling of the
arguments differ. On OSX it will pass arguments correctly
(and run '/usr/bin/env bash -eu'), but on centos it will try to
call '/usr/bin/env "bash bash_arguments"' which will fail.
3. '#!' have to be first two characters.

Shebang is kept in the script body, so its
runnable even if invoked differently. Current invocation of the script is
changed to go via env directly.
Copy link
Contributor

@thbkrkr thbkrkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for correcting this.

@david-kow david-kow merged commit 09cc7cc into elastic:master Jun 14, 2019
@david-kow david-kow deleted the fix_scripts branch June 14, 2019 14:58
@pebrc pebrc added >bug Something isn't working v0.9.0 labels Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug Something isn't working v0.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants