Skip to content

Commit 08a88bf

Browse files
committed
disable unattended upgrades on compute server startup
1 parent d943232 commit 08a88bf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/packages/server/compute/cloud/startup-script.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ ${defineSetStateFunction({ api_key, apiServer, compute_server_id })}
148148
setState state running
149149
150150
# make sure nothing involving apt-get is running (e.g., auto updates)
151+
# Basically, unattended upgrades can randomly run and just totally break
152+
# the startup script, which is really painful.
151153
pkill -9 apt-get || true
154+
apt remove -y unattended-upgrades || true
155+
pkill -f -9 unattended-upgrade || true
152156
153157
${installTime()}
154158
@@ -240,6 +244,9 @@ exec /usr/bin/python3 -u /cocalc/disk_enlarger.py 2> /var/log/cocalc-disk-enlarg
240244
241245
exec /usr/bin/python3 -u /cocalc/check_in.py ${CHECK_IN_PERIOD_S} 2> /var/log/cocalc-check-in.err >/var/log/cocalc-check-in.log &
242246
247+
# Put back unattended upgrades, since they are good to have for security reasons.
248+
apt install -y unattended-upgrades || true
249+
243250
echo "Startup complete!"
244251
`;
245252
}

0 commit comments

Comments
 (0)