Skip to content

Commit d9e0355

Browse files
author
Yuriy Bezsonov
committed
improve code restart in tools.sh
1 parent afe4c89 commit d9e0355

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

infra/scripts/ide/tools.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,14 @@ install_container_tools() {
259259
sudo dnf install -y -q docker >/dev/null
260260
sudo service docker start
261261
sudo usermod -aG docker ec2-user
262-
sudo systemctl restart code-server@ec2-user
262+
263+
# Restart the appropriate IDE service to pick up docker group membership
264+
# IDE_TYPE is set by bootstrap.sh (defaults to code-editor)
265+
if systemctl list-units --type=service | grep -q "code-editor@ec2-user"; then
266+
sudo systemctl restart code-editor@ec2-user
267+
elif systemctl list-units --type=service | grep -q "code-server@ec2-user"; then
268+
sudo systemctl restart code-server@ec2-user
269+
fi
263270

264271
log_info "Installing SOCI snapshotter ${SOCI_VERSION} for ${ARCH_K8S}..."
265272
download_and_verify "https://github.com/awslabs/soci-snapshotter/releases/download/v$SOCI_VERSION/soci-snapshotter-$SOCI_VERSION-linux-${ARCH_K8S}.tar.gz" "soci-snapshotter-$SOCI_VERSION-linux-${ARCH_K8S}.tar.gz" "SOCI snapshotter ${SOCI_VERSION}"

0 commit comments

Comments
 (0)