Skip to content

Commit eb0d46c

Browse files
fix: endpoint with tamper protection deb upgrade (#9462)
* fix: stop elastic-agent service if we need to stop endpoint * fix: re-enable same version over the installed agent endpoint test * chore: add changelog fragment * fix: stop elastic-agent unconditionally in preinstall.sh.tmpl
1 parent ce3862c commit eb0d46c

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
kind: bug-fix
2+
summary: Fix deb upgrade by stopping elastic-agent service before stopping endpoint
3+
component: elastic-agent
4+
pr: https://github.com/elastic/elastic-agent/pull/9462

dev-tools/packaging/templates/linux/preinstall.sh.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
set -e
44

5+
# we need to stop the agent to have all components stopped as well
6+
if systemctl --quiet is-active elastic-agent; then
7+
echo "elastic-agent is running, stopping it"
8+
systemctl --quiet stop elastic-agent
9+
else
10+
echo "elastic-agent is not running"
11+
fi
12+
513
SERVICE_NAME="ElasticEndpoint"
614

715
# Check if the endpoint service is installed

testing/integration/ess/endpoint_security_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ func TestUpgradeAgentWithTamperProtectedEndpoint_DEB(t *testing.T) {
8282
})
8383

8484
t.Run("Install same version over the installed agent", func(t *testing.T) {
85-
t.Skip("This constantly fails, so skipping until further investigation is done and a fix is implemented")
8685
testTamperProtectedInstallUpgrade(t, info, "deb", define.Version(), false, false)
8786
})
8887

0 commit comments

Comments
 (0)