Skip to content

Commit bfc34e3

Browse files
stephenmsachsStephen Sachs
andauthored
Allow apt-get to upgrade openssh-server in 3.x (aws#4358)
Allow `apt-get` to upgrade openssh-server This fixes a hang in `pcluster build-image` when `Build:UpdateOsPackages:Enabled:true` is set. `apt-get upgrade` will prompt for user input during upgrade of `openssh-server` as `/etc/ssh/ssd_config` is locally modified and would be overwritten by package provided file. The proposed patch removes the prompt and chooses to keep the existing configuration file. I can see this issue pop up on ubuntu-{1804,2004} in pcluster-[3.1.1-3.1.4]. I did not test older releases, but would expect it to occur there do. Co-authored-by: Stephen Sachs <[email protected]>
1 parent 874f95f commit bfc34e3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ CHANGELOG
2626
- Avoid failing on DescribeCluster when cluster configuration is not available.
2727
- Fix `UpdateParallelClusterLambdaRole` in the ParallelCluster API to upload logs to CloudWatch.
2828
- Fix Cinc not using the local CA certificates bundle when installing packages before any cookbooks are executed.
29+
- Fix a hang in upgrading ubuntu via `pcluster build-image` when `Build:UpdateOsPackages:Enabled:true` is set.
2930

3031
3.2.0
3132
------

cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ phases:
119119
while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done
120120
flock $(apt-config shell StateDir Dir::State/d | sed -r "s/.*'(.*)\/?'$/\1/")/daily_lock systemctl disable --now apt-daily.timer apt-daily.service apt-daily-upgrade.timer apt-daily-upgrade.service
121121
sed "/Update-Package-Lists/s/\"1\"/\"0\"/; /Unattended-Upgrade/s/\"1\"/\"0\"/;" /etc/apt/apt.conf.d/20auto-upgrades > "/etc/apt/apt.conf.d/51pcluster-unattended-upgrades"
122-
DEBIAN_FRONTEND=noninteractive apt-get -y update && apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --with-new-pkgs upgrade && apt-get --purge autoremove -y
122+
DEBIAN_FRONTEND=noninteractive apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --with-new-pkgs upgrade && apt-get --purge autoremove -y
123123
apt-get -y install linux-aws linux-headers-aws linux-image-aws
124124
fi
125125

0 commit comments

Comments
 (0)