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

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 11 Jan 2023 15:40:49 UTC

John Grafton <john.grafton@runbox.com> changed:

           What    |Removed                     |Added
                 CC|                            |john.grafton@runbox.com

--- Comment #3 from John Grafton <john.grafton@runbox.com> ---
I've definitely been burned by forgetting to turn off freebsd-update in cron
and then attempting an upgrade by hand.  A collision doesn't happen very often
but it's annoying when it does.  Frankly, I always forget about the cron job.

I spent some time hacking together a proof of concept patch to freebsd-update
that implements a lock on the work directory by splitting the config parsing
and command functions into a different scripts and then calling the command
script with lockf(1).  If another instance of freebsd-update attempts to use a
work directory that's already locked, it fails with an error message.

The patched script works well enough but is super ugly.  Before putting the
patch up for review, I'll break out each function that requires a lock
individually instead of my current version that just locks all functions. 
Like, showconfig doesn't need to lock the work directory.  Neither does the
cron function while it's asleep during the splay time.

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