From a401d1328f0516022f54e3ae51bb50f5da8b7625 Mon Sep 17 00:00:00 2001 From: Giacomo Marciani Date: Wed, 17 Dec 2025 18:04:45 -0500 Subject: [PATCH] [BuildImage] Prevent service restarts during installation of ubuntu-desktop, required by DCV, to avoid SSM agent connecgtivity issue. In particular: * Add NEEDRESTART_MODE=l environment variable to suppress needrestart prompts during installation --- .../resources/dcv/partial/_ubuntu_common.rb | 1 + .../aws-parallelcluster-platform/spec/unit/resources/dcv_spec.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb b/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb index 4c490468f8..00e9b38e72 100644 --- a/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb +++ b/cookbooks/aws-parallelcluster-platform/resources/dcv/partial/_ubuntu_common.rb @@ -45,6 +45,7 @@ def pre_install code <<-PREREQ set -e DEBIAN_FRONTEND=noninteractive + NEEDRESTART_MODE=l apt -y install whoopsie apt -y install ubuntu-desktop && apt -y install mesa-utils || (dpkg --configure -a && exit 1) apt -y purge ifupdown diff --git a/cookbooks/aws-parallelcluster-platform/spec/unit/resources/dcv_spec.rb b/cookbooks/aws-parallelcluster-platform/spec/unit/resources/dcv_spec.rb index 2ca8cb6d06..904ba2c311 100644 --- a/cookbooks/aws-parallelcluster-platform/spec/unit/resources/dcv_spec.rb +++ b/cookbooks/aws-parallelcluster-platform/spec/unit/resources/dcv_spec.rb @@ -472,6 +472,7 @@ def self.nothing(chef_run) when 'ubuntu' is_expected.to periodic_apt_update('') is_expected.to run_bash('install pre-req').with_cwd(Chef::Config[:file_cache_path]).with_retries(10).with_retry_delay(5) + .with_code(/NEEDRESTART_MODE=l/) .with_code(/apt -y install whoopsie/) .with_code(/apt -y install ubuntu-desktop && apt -y install mesa-utils || (dpkg --configure -a && exit 1)/) .with_code(/apt -y purge ifupdown/)