Skip to content

Commit

Permalink
[Elastic Agent] Ensure shell wrapper path exists on install. (#22144)
Browse files Browse the repository at this point in the history
* Ensure wrapper path on install.

* Add changelog.
  • Loading branch information
blakerouse authored Oct 27, 2020
1 parent f0da681 commit 5f83f60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- Rename monitoring index from `elastic.agent` to `elastic_agent` {pull}21932[21932]
- Fix issue with named pipes on Windows 7 {pull}21931[21931]
- Fix missing elastic_agent event data {pull}21994[21994]
- Ensure shell wrapper path exists before writing wrapper on install {pull}22144[22144]

==== New features

Expand Down
5 changes: 4 additions & 1 deletion x-pack/elastic-agent/pkg/agent/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ func Install() error {

// place shell wrapper, if present on platform
if ShellWrapperPath != "" {
err = ioutil.WriteFile(ShellWrapperPath, []byte(ShellWrapper), 0755)
err = os.MkdirAll(filepath.Dir(ShellWrapperPath), 0755)
if err == nil {
err = ioutil.WriteFile(ShellWrapperPath, []byte(ShellWrapper), 0755)
}
if err != nil {
return errors.New(
err,
Expand Down

0 comments on commit 5f83f60

Please sign in to comment.