Skip to content

Commit

Permalink
Cherry-pick #23496 to 7.x: Agent fetching DBus service PID fix (#23525)
Browse files Browse the repository at this point in the history
* [Ingest Manager] Agent fetching DBus service PID fix (#23496)

[Ingest Manager] Agent fetching DBus service PID fix (#23496)

* Update CHANGELOG.next.asciidoc
  • Loading branch information
michalpristas authored Jan 17, 2021
1 parent 424b34b commit 1f24f1a
Show file tree
Hide file tree
Showing 2 changed files with 7 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 @@ -33,6 +33,7 @@
- Support for linux/arm64 {pull}23479[23479]
- 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 1f24f1a

Please sign in to comment.