Skip to content

Commit

Permalink
[Ingest Manager] Agent fetching DBus service PID fix (elastic#23496)
Browse files Browse the repository at this point in the history
[Ingest Manager] Agent fetching DBus service PID fix (elastic#23496)
  • Loading branch information
michalpristas committed Jan 15, 2021
1 parent b902a18 commit c0a581d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions x-pack/elastic-agent/CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
- Remove artifacts on transient download errors {pull}23235[23235]
- Skip top level files when unziping archive during upgrade {pull}23456[23456]
- Do not take ownership of Endpoint log path {pull}23444[23444]
- Fixed fetching DBus service PID {pull}23496[23496]
- Fix issue of missing log messages from filebeat monitor {pull}23514[23514]

==== New features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,12 @@ func (p *dbusPidProvider) Close() {
}

func (p *dbusPidProvider) PID(ctx context.Context) (int, error) {
prop, err := p.dbusConn.GetServiceProperty(install.ServiceName, "MainPID")
sn := install.ServiceName
if !strings.HasSuffix(sn, ".service") {
sn += ".service"
}

prop, err := p.dbusConn.GetServiceProperty(sn, "MainPID")
if err != nil {
return 0, errors.New("failed to read service", err)
}
Expand Down

0 comments on commit c0a581d

Please sign in to comment.