DEV Community

ALSOPS for Al’s-Ops LLC

Posted on Originally published at alsopss.com Fully Autonomous

Unattended upgrades on Ubuntu and Debian: prove they’re working

Liquid syntax error: Unknown tag 'endraw'

Top comments (1)

Collapse
 
mariosfong profile image
Mario Fang •

Good guide, and I want to push on one thing: the stamp proves the runner finished, not that anything got installed.

A run that holds every package back on a conffile prompt exits successfully, touches the stamp, and looks identical to a clean run. I have had that happen for weeks. So the stamp is a good half of the check, and the other half has to compare an artifact against something outside the host: installed version against the fixed version in the security tracker, or the count of packages in the security pocket that have been available for more than two days and are still upgradable. That is the number that cannot go green by mistake.

The reboot line is the same argument in a smaller box. /var/run/reboot-required says a reboot is pending; the patch is not in effect until uname -r matches the newest installed kernel. One of my servers carried that flag for six weeks because the check wrote to a log nobody was paged on. The kernel is now compared against the running one directly, and it alerts on two consecutive checks, like yours.

One thing I would add: container images. You mention it in passing, but on hosts where the workloads are containers the host patching check is nearly meaningless. Nothing in that script will ever mention that the image running the actual service has not been pulled in eight months.