-
Notifications
You must be signed in to change notification settings - Fork 203
Refactor user change on service #8347
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
Conversation
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
|
need to figure out some Server vs Home behavior differences |
|
This pull request is now in conflicts. Could you fix it? 🙏 |
blakerouse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for working through the code review.
|
💚 Build Succeeded
History
|
|
@Mergifyio backport 9.0 9.1 |
✅ Backports have been created
|
(cherry picked from commit f942cf9) # Conflicts: # NOTICE-fips.txt # go.mod
(cherry picked from commit f942cf9)
* upstream: (39 commits) Fix otel extension status reporting (#8696) Refactor user change on service (#8347) [AutoOps] Add `autoops-es.yml` to Packages (#8728) EDOT collector: include the forward connector. (#8753) Revert "ci: pin elastic-agent version (#8736)" (#8754) bk: retry Start ESS stack for integration tests (#8553) Re-enable TestStandaloneUpgradeRollbackOnRestarts on windows (#8718) removed reviewers from dependabot.yml (#8709) Pass `--header` enrollment option to fleet-server (#8071) Add ability for local output configuration to add to policy configuration (#8766) Bump up github.com/go-viper/mapstructure/v2 dependency (#8764) [Synthetics] Upgrade node to latest lts v20 (#8712) [CI] BK Vault plugin for EC access (#8377) feat: singleTest mage target for each integration test package (#8691) ci: always include 8.19 LTS release branch in snapshots of test versions (#8761) build(deps): bump github.com/elastic/mito from 1.19.0 to 1.20.0 (#8755) chore: fix elastic-agent helm chart examples (#8765) feat: support onboarding-id for kubernetes (#8692) [main][Automation] Bump VM Image version to 1751072471 (#8734) ci: revert deployment_csp_configuration.yaml to create_deployment_csp_configuration.yaml (#8746) ...


This PR refactor the way how we do User change during
unprivilegedandprivilegedactions.Pre-PR we removed and reinstalled service again with new user setup.
Post-PR we rewrite service file directly (linux and darwin) or use syscall to change config (windows). Then we restart service.
This reduces window for interrupt.
While pre-PR could leave us without a service, in this case we haven't won entirely. We can end up with broken service when service manager decides config/user is not valid/enabled. This at least leaves a trace in system logs.
Tests covering switch between privilege modes are already present
Closes: #8268