Skip to content

[Backport 7.68.x] fix(rpm): Stop the agent in legacy preinst #39218

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

Closed
wants to merge 1 commit into from

Conversation

BaptisteFoy
Copy link
Contributor

Backport 6468c25 from #39190.


What does this PR do?

#37078 removed the agent stop command from the RPM preinst to migrate it in the installer, while #37084 preserved some preinst commands in bash for upgrades from older agents. The combination of these two prevents us from stopping the agent before upgrading from an older version, leaving compiled Python files on disk after the upgrade that are not removed by an uninstallation of the agent.

Motivation

Describe how you validated your changes

Manual QA

Possible Drawbacks / Trade-offs

Additional Notes

@BaptisteFoy BaptisteFoy requested review from a team as code owners July 24, 2025 06:55
@BaptisteFoy BaptisteFoy added changelog/no-changelog qa/done QA done before merge and regressions are covered by tests team/fleet-automation backport labels Jul 24, 2025
@github-actions github-actions bot added the short review PR is simple enough to be reviewed quickly label Jul 24, 2025
@agent-platform-auto-pr
Copy link
Contributor

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor d9bfd7f

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${+0.01}$$ $${696.42}$$ < $${752.99}$$ $${+0}$$ $${176.08}$$ < $${187.44}$$
agent_deb_amd64_fips $${+0.08}$$ $${694.72}$$ < $${751.36}$$ $${-0.02}$$ $${175.54}$$ < $${187.06}$$
agent_heroku_amd64 $${-0}$$ $${358.71}$$ < $${369.68}$$ $${+0.01}$$ $${96.53}$$ < $${99.55}$$
agent_msi $${+0.01}$$ $${958.91}$$ < $${987.01}$$ $${-0.03}$$ $${146.29}$$ < $${150.72}$$
agent_rpm_amd64 $${+0.01}$$ $${696.41}$$ < $${752.98}$$ $${+0.01}$$ $${177.62}$$ < $${190.03}$$
agent_rpm_amd64_fips $${+0.08}$$ $${694.71}$$ < $${751.35}$$ $${+0.04}$$ $${177.52}$$ < $${189.81}$$
agent_rpm_arm64 $${+0.01}$$ $${686.43}$$ < $${739.42}$$ $${+0.01}$$ $${161.04}$$ < $${171.23}$$
agent_rpm_arm64_fips $${+0.07}$$ $${684.84}$$ < $${737.91}$$ $${+0.05}$$ $${160.2}$$ < $${170.22}$$
agent_suse_amd64 $${+0.01}$$ $${696.41}$$ < $${752.98}$$ $${+0.01}$$ $${177.62}$$ < $${190.03}$$
agent_suse_amd64_fips $${+0.08}$$ $${694.71}$$ < $${751.35}$$ $${+0.04}$$ $${177.52}$$ < $${189.81}$$
agent_suse_arm64 $${+0.01}$$ $${686.43}$$ < $${739.42}$$ $${+0.01}$$ $${161.04}$$ < $${171.23}$$
agent_suse_arm64_fips $${+0.07}$$ $${684.84}$$ < $${737.91}$$ $${+0.05}$$ $${160.2}$$ < $${170.22}$$
docker_agent_amd64 $${+0.01}$$ $${780.22}$$ < $${849.39}$$ $${+0.02}$$ $${268.69}$$ < $${288.34}$$
docker_agent_arm64 $${+0.08}$$ $${793.74}$$ < $${858.97}$$ $${+0.02}$$ $${256.06}$$ < $${274.36}$$
docker_agent_jmx_amd64 $${+0.01}$$ $${971.42}$$ < $${1040.59}$$ $${+0.01}$$ $${337.66}$$ < $${357.3}$$
docker_agent_jmx_arm64 $${+0.08}$$ $${973.54}$$ < $${1038.77}$$ $${+0.01}$$ $${321.02}$$ < $${339.32}$$
docker_agent_windows1809 $${+0.01}$$ $${1487.08}$$ < $${1557.19}$$ $${+0.06}$$ $${488.06}$$ < $${507.33}$$
docker_agent_windows1809_core $${+0.01}$$ $${6217.04}$$ < $${6287.46}$$ $${0}$$ $${2048.0}$$ < $${2067.76}$$
docker_agent_windows1809_core_jmx $${-0.19}$$ $${6338.61}$$ < $${6409.04}$$ $${0}$$ $${2048.0}$$ < $${2067.76}$$
docker_agent_windows1809_jmx $${+0.01}$$ $${1608.71}$$ < $${1679.14}$$ $${-0.08}$$ $${530.29}$$ < $${550.27}$$
docker_agent_windows2022 $${+0.14}$$ $${1506.31}$$ < $${1576.85}$$ $${+0.01}$$ $${500.75}$$ < $${520.76}$$
docker_agent_windows2022_core $${+0.04}$$ $${6190.13}$$ < $${6260.53}$$ $${0}$$ $${2048.0}$$ < $${2067.76}$$
docker_agent_windows2022_core_jmx $${+0}$$ $${6311.77}$$ < $${6382.17}$$ $${0}$$ $${2048.0}$$ < $${2067.76}$$
docker_agent_windows2022_jmx $${-0.17}$$ $${1627.79}$$ < $${1698.2}$$ $${-0}$$ $${543.02}$$ < $${562.99}$$
docker_cluster_agent_amd64 $${+0.01}$$ $${212.85}$$ < $${259.73}$$ $${+0}$$ $${72.38}$$ < $${103.68}$$
docker_cluster_agent_arm64 $${+0.07}$$ $${228.75}$$ < $${274.24}$$ $${+0.01}$$ $${68.65}$$ < $${98.45}$$
docker_cws_instrumentation_amd64 $${-0}$$ $${7.08}$$ < $${7.12}$$ $${-0}$$ $${2.95}$$ < $${3.29}$$
docker_cws_instrumentation_arm64 $${-0}$$ $${6.69}$$ < $${6.92}$$ $${+0}$$ $${2.7}$$ < $${3.07}$$
docker_dogstatsd_amd64 $${-0.02}$$ $${39.2}$$ < $${39.57}$$ $${-0.01}$$ $${15.11}$$ < $${15.76}$$
docker_dogstatsd_arm64 $${-0.02}$$ $${37.86}$$ < $${38.2}$$ $${-0.01}$$ $${14.52}$$ < $${14.83}$$
dogstatsd_deb_amd64 $${+0}$$ $${30.45}$$ < $${31.52}$$ $${-0}$$ $${8.0}$$ < $${8.97}$$
dogstatsd_deb_arm64 $${-0}$$ $${29.02}$$ < $${30.08}$$ $${-0}$$ $${6.94}$$ < $${7.92}$$
dogstatsd_rpm_amd64 $${+0}$$ $${30.45}$$ < $${31.52}$$ $${+0}$$ $${8.01}$$ < $${8.98}$$
dogstatsd_suse_amd64 $${+0}$$ $${30.45}$$ < $${31.52}$$ $${+0}$$ $${8.01}$$ < $${8.98}$$
iot_agent_deb_amd64 $${-0}$$ $${50.42}$$ < $${60.17}$$ $${-0}$$ $${12.84}$$ < $${15.82}$$
iot_agent_deb_arm64 $${-0}$$ $${47.9}$$ < $${56.94}$$ $${+0}$$ $${11.14}$$ < $${13.86}$$
iot_agent_deb_armhf $${-0}$$ $${47.47}$$ < $${56.41}$$ $${+0}$$ $${11.21}$$ < $${13.86}$$
iot_agent_rpm_amd64 $${-0}$$ $${50.42}$$ < $${60.18}$$ $${+0}$$ $${12.86}$$ < $${15.84}$$
iot_agent_rpm_arm64 $${-0}$$ $${47.9}$$ < $${56.94}$$ $${-0}$$ $${11.16}$$ < $${13.76}$$
iot_agent_suse_amd64 $${-0}$$ $${50.42}$$ < $${60.18}$$ $${+0}$$ $${12.86}$$ < $${15.84}$$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport changelog/no-changelog qa/done QA done before merge and regressions are covered by tests short review PR is simple enough to be reviewed quickly team/fleet-automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants