Skip to content

Commit 3f538f6

Browse files
committed
Disable Ubuntu unattended upgrade
`APT::Periodic::Update-Package-Lists` allows you to specify the frequency (in days) at which the package lists are refreshed (0=disable). `APT::Periodic::Unattended-Upgrade` When this option is enabled, the daily script will execute unattended-upgrade from the `unattended-upgrades` package. The default configuration file for the `unattended-upgrades` package is at `/etc/apt/apt.conf.d/50unattended-upgrades` we're overriding it by writing the `51unattended-upgrades` file. Related patches (for 3.0.0): * aws/aws-parallelcluster#2915 * aws/aws-parallelcluster#3267 Signed-off-by: Enrico Usai <[email protected]>
1 parent dab8852 commit 3f538f6

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This file is used to list changes made in each version of the AWS ParallelCluste
1111
- Upgrade Slurm to version 20.11.8.
1212
- Upgrade Cinc Client to version 17.2.29.
1313
- Upgrade NICE DCV to version 2021.2-11190.
14+
- Disable unattended upgrades for Ubuntu.
1415

1516
2.11.3
1617
-----

amis/packer_ubuntu1804.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@
167167
{
168168
"type": "shell",
169169
"inline": [
170-
"sudo flock $(apt-config shell StateDir Dir::State/d | sed -r \"s/.*'(.*)\\/?'$/\\1/\")/daily_lock systemctl stop apt-daily.timer apt-daily.service apt-daily-upgrade.timer apt-daily-upgrade.service"
170+
"sudo 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",
171+
"sudo sh -c \"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\""
171172
]
172173
},
173174
{

amis/packer_ubuntu2004.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@
167167
{
168168
"type": "shell",
169169
"inline": [
170-
"sudo flock $(apt-config shell StateDir Dir::State/d | sed -r \"s/.*'(.*)\\/?'$/\\1/\")/daily_lock systemctl stop apt-daily.timer apt-daily.service apt-daily-upgrade.timer apt-daily-upgrade.service"
170+
"sudo 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",
171+
"sudo sh -c \"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\""
171172
]
172173
},
173174
{

0 commit comments

Comments
 (0)