Skip to content

Commit d42ca5a

Browse files
committed
actually source of the last hyperstack issue was NOT unattended upgrades
1 parent 27a53e1 commit d42ca5a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,23 @@ ${ephemeral}
5858
content: |
5959
#!/bin/bash
6060
${await startupScriptViaApi({ compute_server_id, api_key })}
61+
if [ $? -eq 0 ]; then
62+
exit 0
63+
fi
6164
# If the script fails (e.g., due to timing weirdness), we
6265
# try restarting docker and running it again.
6366
sleep 1
6467
service docker restart
6568
${await startupScriptViaApi({ compute_server_id, api_key })}
69+
if [ $? -eq 0 ]; then
70+
exit 0
71+
fi
6672
sleep 3
6773
service docker restart
6874
${await startupScriptViaApi({ compute_server_id, api_key })}
75+
if [ $? -eq 0 ]; then
76+
exit 0
77+
fi
6978
7079
runcmd:
7180
- |
@@ -244,6 +253,9 @@ exec /usr/bin/python3 -u /cocalc/disk_enlarger.py 2> /var/log/cocalc-disk-enlarg
244253
245254
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 &
246255
256+
# Put back unattended upgrades, since they are good to have for security reasons.
257+
apt-get install -y unattended-upgrades || true
258+
247259
echo "Startup complete!"
248260
`;
249261
}

0 commit comments

Comments
 (0)