Skip to content

Commit 00e2946

Browse files
wip
1 parent ec7545f commit 00e2946

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if test -L "$symlink"; then
1515
fi
1616

1717
SERVICE_NAME="ElasticEndpoint"
18+
should_restart_endpoint=false
1819

1920
echo "Checking if $SERVICE_NAME is installed"
2021
if systemctl list-unit-files --type=service | grep -q "^${SERVICE_NAME}.service"; then
@@ -27,8 +28,7 @@ if systemctl list-unit-files --type=service | grep -q "^${SERVICE_NAME}.service"
2728
echo "$SERVICE_NAME is installed but not running"
2829
if [[ "$installed_endpoint_version" == "$archive_endpoint_version" ]]; then
2930
echo "New endpoint and installed endpoint versions are the same: \"${installed_endpoint_version}\""
30-
echo "Starting $SERVICE_NAME"
31-
sudo systemctl start ${SERVICE_NAME}
31+
should_restart_endpoint=true
3232
else
3333
echo "New endpoint version \"${archive_endpoint_version}\" is different than the one that's already
3434
installed \"${installed_endpoint_version}\""
@@ -53,4 +53,9 @@ echo "systemd enable/restart elastic-agent"
5353
systemctl daemon-reload 2> /dev/null
5454
systemctl enable elastic-agent 2> /dev/null || true
5555
systemctl restart elastic-agent 2> /dev/null || true
56+
# restart endpoint if needed
57+
if [ "$should_restart_endpoint" = true ]; then
58+
echo "Starting $SERVICE_NAME after elastic-agent"
59+
systemctl restart "$SERVICE_NAME" 2> /dev/null || true
60+
fi
5661
exit 0

testing/integration/endpoint_security_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ func TestUpgradeAgentWithTamperProtectedEndpoint_RPM(t *testing.T) {
109109
},
110110
})
111111

112-
t.Skip("https://github.com/elastic/elastic-agent/issues/8613: Flaky uninstall token issue")
113-
114112
t.Run("Upgrade from older version to newer version", func(t *testing.T) {
115113
upgradeFromVersion, err := upgradetest.PreviousMinor()
116114
require.NoError(t, err)

0 commit comments

Comments
 (0)