Updates¶
flyingport-update runs every minute from root's cron. It is quiet when there is nothing to do. When there is a newer
release – or the same release's build for an upgraded OpenBSD (below) – it:
- downloads it and its
SHA256.sig, and checks the signature with/etc/signify/flyingport.pub– a release that does not match is not installed; - stops FlyingPort and copies the database to
/home/flyingport/backups/<date>-<old version>/; - migrates the database with the new release, starts it and waits for
/health; - on a failed migration or health check, starts the old release with the database copy again;
- installs the new release's own
flyingport-updateand rc.d script – never the key: which key a release is checked with stays your choice; - keeps the 3 newest releases and the 10 newest backups.
It never installs an older version. What it changes or what fails goes to syslog (/var/log/messages) and, through
cron, to root's mail. To update now: /usr/local/sbin/flyingport-update.
| Exit code | Meaning |
|---|---|
| 0 | Up to date, or updated |
| 1 | /etc/flyingport-update.conf missing or incomplete |
| 2 | The newest version or a file could not be downloaded |
| 3 | The signature does not match: nothing installed |
| 4 | Unpacking or the migration failed: the old release runs again |
| 5 | The new release did not answer /health: the old release runs again |
| 6 | The rollback failed too: FlyingPort is down, look at it |
| 7 | Updated, but the release's own scripts could not be installed |
Upgrading OpenBSD¶
Each release is built for one OpenBSD release (FlyingPort's Erlang links against the system's libraries), and the registry holds a build for both supported releases. Upgrade OpenBSD as usual:
sysupgrade # reboots into the new release
sysmerge
pkg_add -u
reboot
Within a minute flyingport-update notices that the system is no longer the one the running release was built for (it
remembers that in /home/flyingport/current/.target) and installs the same version's build for the new release: it
stops FlyingPort, copies the database to backups/, starts the new build and waits for /health – it logs "this system
is openbsd-8.0_arm64 now, … was built for openbsd-7.9_arm64". There is no going back to the old build: it does not run
on the new system. Check it with rcctl check flyingport and tail /var/log/messages.
A server that was upgraded before FlyingPort 0.1.5 ran there does not know its build yet; there, once after the upgrade:
rcctl stop flyingport
rm /home/flyingport/current
/usr/local/sbin/flyingport-update