[Bug 266270] freebsd-update cron corrupts freebsd-update upgrade's in progress

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 07 Sep 2022 13:20:01 UTC

            Bug ID: 266270
           Summary: freebsd-update cron corrupts freebsd-update upgrade's
                    in progress
           Product: Base System
           Version: 12.3-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: pen@lysator.liu.se

I've been running "freebsd-update cron" from cron every night at 23:10 to get
notifications for needed updates for a long time. This is working fine.

What isn't working fine is I've I initiate an OS upgrade using "freebsd-update
upgrade -r <new version>" before the cron job runs, and then finalize the
upgrade after the cron job has run... Which for me has happened multiple times
now since that is a good time to perform the upgrades :-)

This seems to cause a partially updated system that is very confused - which
causes future pkg upgrade and "freebsd-update fetch install"-updates to become
even more confused (sometimes starts to delete "random" files from the running
system since it thinks they aren't needed anymore).

One way I've noticed to detect this situation is to do a "file /usr/bin/uname"
and see what OS version the uname binary is from.

Suggestion: Add some fail safe mechanism to "freebsd-update cron" that detects
an OS-upgrade in progress and stop it from downloading updates for the old OS
version and mix them up with the new OS updates.

You are receiving this mail because:
You are the assignee for the bug.