Automatic update (nightly)
Runs the full update every night between 02:00 and 02:30 – Debian packages, app, modules and iac, without a reboot – and restarts the services that still run with replaced libraries. Log: journalctl -u iac-auto-update
Add to a guest
In the guest as root – container and VM alike:
update --add-modules auto-updateRuns a normal update and installs the module on the way.
From the Proxmox node, without logging in:
pct exec <ID> -- update --add-modules auto-update # container
ssh root@<IP> update --add-modules auto-updateChoose when creating a guest
Without a dialog, on the Proxmox node:
IAC_NONINTERACTIVE=1 var_modules=auto-update \
bash -c "$(curl -fsSL https://haypack.dev/<app>/ct.sh)"var_modules replaces the app's preselection – keep auto-update in the list if you want it. Interactive: choose “advanced” in the dialog, or tick the module in the generator on the app page.
Remove
update --remove-modules auto-updateRemoves the module's packages, services, firewall rules and configuration again. Data stays.
Details
Runs the full update every night between 02:00 and 02:30 (local time of the guest): Debian
packages, app, modules and iac – exactly like running it by hand, without a reboot and without a
release upgrade. Each guest has its own fixed time in that half hour, so not all of them load at
once; a guest that was off at that time catches up when it starts.
The module is preselected for new guests. If you do not want it, deselect it when you create the
guest or remove it later with update --remove-modules auto-update. Existing guests get it with
update --add-modules auto-update.
systemctl list-timers iac-auto-update.timer # next run
journalctl -u iac-auto-update # output of the last runs
Services with replaced libraries
After the Debian upgrade, services can still run with the old libraries in memory – a fixed
vulnerability stays open in them until they restart. The nightly run restarts them
(needrestart -r a), before the app and the modules are updated; the guest itself is never
rebooted (a new kernel: field Reboot needed, tag iac-reboot-now). An update by hand only
lists them.
Services that must not restart at night go into /etc/iac/settings.env, then update:
auto_update_restart_exclude=postgresql mariadb # names match from the start
auto_update_restart_exclude=all # restart nothing, only list
Never restarted: iac-auto-update itself – the update runs in it – and what Debian’s needrestart
leaves out on its own (dbus, getty …) – they wait for the next reboot. systemd-logind and
unattended-upgrades are restarted, although Debian leaves them out too. Which services wait:
needrestart -b or the security report.
If an update is running by hand, the nightly run waits for it. An active backup only starts
once the update has finished.
Führt jede Nacht zwischen 02:00 und 02:30 Uhr (Ortszeit des Gasts) das vollständige update
aus: Debian-Pakete, App, Module und iac – genau wie von Hand, ohne Neustart und ohne
Release-Upgrade. Jeder Gast hat in dieser halben Stunde seine feste Zeit, damit nicht alle
gleichzeitig laden; ein Gast, der zu der Zeit aus war, holt das Update beim Start nach.
Das Modul ist für neue Gäste vorausgewählt. Wer es nicht möchte, wählt es beim Erstellen des Gasts
ab oder entfernt es später mit update --remove-modules auto-update. Bestehende Gäste bekommen es
mit update --add-modules auto-update.
systemctl list-timers iac-auto-update.timer # nächster Lauf
journalctl -u iac-auto-update # Ausgabe der letzten Läufe
Dienste mit ersetzten Bibliotheken
Nach dem Debian-Upgrade können Dienste noch mit den alten Bibliotheken im Speicher laufen – eine
behobene Schwachstelle bleibt in ihnen offen, bis sie neu starten. Der nächtliche Lauf startet sie
neu (needrestart -r a), bevor App und Module aktualisiert werden; der Gast selbst wird nie neu
gestartet (bei einem neuen Kernel: Feld Reboot needed, Tag iac-reboot-now). Ein update von
Hand listet sie nur auf.
Dienste, die nachts nicht neu starten dürfen, gehören in /etc/iac/settings.env, danach update:
auto_update_restart_exclude=postgresql mariadb # Namen passen vom Anfang her
auto_update_restart_exclude=all # nichts neu starten, nur auflisten
Nie neu gestartet werden iac-auto-update selbst – darin läuft das Update – und was Debians
needrestart von sich aus auslässt (dbus, getty …) – sie warten auf den nächsten Neustart des Gasts.
systemd-logind und unattended-upgrades startet das Update neu, obwohl Debian auch sie auslässt.
Welche Dienste warten: needrestart -b oder der Sicherheitsbericht.
Läuft gerade ein update von Hand, wartet der nächtliche Lauf darauf. Ein aktives backup
startet erst, wenn das Update fertig ist.