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

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

Merged
merged 4 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -32,6 +32,7 @@
- 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]

==== 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