Skip to content

v0.16.0 — sysupdate

Choose a tag to compare

@ralyodio ralyodio released this 30 Aug 07:00
· 2 commits to master since this release
ee29b26

One new command, and a provisioner that stops leaving boxes with no slack.

sysupdate

Updating a machine was three commands nobody could quite remember the order of. Now it is one, and the pit gets it as /update.

sysupdate                # apt update, apt upgrade, snap refresh
sysupdate --yes          # ...without stopping to ask
sysupdate --no-snap      # apt only
sysupdate --dry-run      # print the commands, run nothing

It runs the three steps in order and stops at the first that fails, which is the && the one-liner had: there is no point upgrading against package lists that failed to refresh.

Three decisions worth knowing about:

  • apt, not apt-get. They are not the same command — apt upgrade installs a package that needs a new dependency, apt-get upgrade holds it back. That difference is how kernels and security updates quietly never land on a box everybody believes is current.
  • sudo only when not already root. A minimal image may have no sudo on it at all, and asking for it there fails for a reason that has nothing to do with updating anything.
  • A box with no snapd skips that step and says so, rather than reporting a failure for something that was never going to run. A box with no apt is refused outright rather than left two thirds updated.

When the upgrade lands a kernel or a libc it names the packages and says a reboot is required — that being exactly the moment people stop thinking about it.

It is called sysupdate and not update because cli-tools update already means "move this checkout to the current commit". One word cannot usefully mean both that and "upgrade the operating system". The pit alias is /update, which is safe because nothing on PATH answers to that name.

root-ubuntu.sh: 2G of swap on a box that has none

A box with no swap has no slack: the kernel's only answer to a memory spike is the OOM killer, and what it picks is whatever was biggest — the build, the language server, the editor someone was working in.

The step only acts where there is no swap whatsoever, so a machine with a swap partition or zram is left exactly as it is rather than gaining a second swapfile nobody remembers making. It declines where a plain swapfile is wrong or dangerous (btrfs needs chattr +C and no compression; a swapfile on zfs can deadlock the box under exactly the pressure it was added to survive), inside a container where the kernel and its swap belong to the host, and when the disk cannot spare the space. vm.swappiness goes to 10 alongside — the default of 60 pages out memory that is still in use, which is how swap earned its reputation. SWAP_SIZE=0 turns it off.

Also

  • one ssh-agent per user, under systemd
  • the hardware inventory set installed by default: lm-sensors, smartmontools, nvme-cli, ipmitool, acpi, powertop, with sensor detection on bare metal
  • companions: diskpush, and installers that are not npm
  • porkbun: Porkbun's own pre-flight, structured refusals kept structured, and the fact that registration spends prepaid credit rather than a card

Full changelog: v0.15.0...v0.16.0