The Problem With Night Reboots

My fleet updater installs stable updates. It schedules reboots for a quiet window at night. It has guards: it waits for streams to end, for backups to finish and for peers to be healthy. It has worked. But the last time something went wrong at night, I found out in the morning. By then, the internet had been down for a while.

Three hypervisors (Din, Nayru and Farosh) waited on the same new kernel. So I decided to do it the other way around: reboot them on purpose, one at a time, while I was awake to watch.

The Moving Parts

Two parts of the network have failover by design:

  • Egress. LAN clients use a virtual gateway address. A gateway container on Nayru holds it (VRRP master). A standby container on Din holds the same address as backup. It takes over if the master disappears.
  • DNS. The primary resolver runs on Nayru and the secondary runs on Din. DHCP gives out both.

Everything else on Nayru has no failover by design. That includes the reverse proxy and the SSO portal. If Nayru is down, the internal web UIs are down too. I accept that trade-off for a single-site lab.

Order of Operations

The order is the most important part:

  1. Farosh first. It is the GPU and NAS node. It has no internet impact, so it is a good warm-up.
  2. Din second. It has the database cluster, the secondary resolver and the standby gateway. The primary resolver and master gateway keep the house online.
  3. Nayru last. This is the real test. The gateway address must move to Din, and DNS must fall back to the secondary.

I did three things before each step. First, I ran a post-boot self-check on every host. It verifies guests, services, firewall tables, DNS, the proxy and SSO. Second, I looked at what a reboot could interrupt (streams, backups, uploads). Third, I made sure that the system had already built the out-of-tree GPU driver for the new kernel.

Watching From the Client’s Side

Server-side health checks tell you that a service is up. They do not tell you what a laptop sees. So I wrote a tiny probe. It runs on my workstation every two seconds and prints only changes:

  • a raw DNS query to each resolver separately,
  • an HTTPS reachability check,
  • who holds the gateway address: it resolves the MAC address and maps it back to a container,
  • the current public IP (every ten seconds).

The Results

Farosh and Din each came back in about two minutes. During Din’s reboot, the internet check did not fail once.

Then Nayru. The probe told the story:

+0:27  gateway address moves to the standby on Din
+0:27  public IP switches to the home line
+0:33  primary DNS stops answering — secondary keeps going
+1:49  primary DNS back
+1:59  master takes the gateway address back
+2:05  public IP returns to normal

Zero failed internet checks in either direction. There was one small problem. For about two minutes after boot, the primary resolver went silent for two to four seconds at a time. It was busy with a rebuild of its large blocklists. The secondary covered every gap.

What the Drill Found

A drill is useful only if it finds something. This one found two things that the night window would have hidden.

1. A boot race on a network mount. A network share on Din did not mount at boot. The journal showed the mount attempt 2.5 seconds before the network card reported link. network-online had fired too early. Worse, the container that uses the share started anyway, on top of the empty directory under it.

The fix is a small one-shot unit that runs before the hypervisor starts its guests. It tries the mount again for up to two minutes. Then it lets boot continue, whatever the result.

2. A timer that never came back. The next morning, uptime monitoring flagged a job that had missed its heartbeat. Its timer had only relative triggers (“10 minutes after boot”, “6 hours after the last run”). After the reboot, systemd scheduled neither.

My recurring jobs now use wall-clock OnCalendar schedules, which survive reboots. Also, systemctl list-timers --all is now part of the post-reboot checklist. If a timer shows no next run, it is boot-only by design or it is broken.

Baking It Into the Updater

The whole procedure is now one command: update-env --reboot-live.

  • It reboots only the hosts that need it. That means a running kernel older than the newest installed one, or a reboot-required flag.
  • It runs the fleet-wide self-check first. If anything is unhealthy, it refuses to start.
  • It uses the same in-use guards as the night window. Between hosts, it waits until the peers have been up for ten minutes.
  • Before it reboots a cloud node, it moves the privacy exit off that node.
  • During every reboot it runs the client probe and waits for the host and its self-check. It stops at the first problem.

Placeholder: terminal screenshot of a reboot-live run

Night reboots still exist for when I am away. But when I am around, I now reboot on purpose and watch. The drill finds the bugs.

Takeaways:

  • Test failover from the side of the client, and not only from the server.
  • Reboot the least critical node first. Reboot the node that owns failover last.
  • Every drill should end with a list of fixes. If it does not, you did not look.

Screenshot 2026 10 24 09 44 24