freebsd / poudriere

Port/Package build and test system
https://github.com/freebsd/poudriere/wiki
BSD 2-Clause "Simplified" License
394 stars 163 forks source link

poudriere should refuse to update a jail that is currenting running #1166

Open leres opened 3 months ago

leres commented 3 months ago

Prerequisites

Describe the bug

I wanted to update a jail to 14.1-RELEASE-p3 today and didn't notice that a poudriere build (started from cron) was still using it. The jail was updated the but gave an error towards the end.

How to reproduce

zinc 47 # poudriere jail -l | fgrep 14release
14release   14.1-RELEASE-p2                   amd64         http      2024-07-01 09:54:33 /usr/local/poudriere/jails/14release
zinc 48 # poudriere jail -u -j 14release
[00:00:00] Upgrading using http
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 14.1-RELEASE from update1.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata patches.. done.
Applying metadata patches... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 12 patches.....10. done.
Applying patches... done.
The following files will be updated as part of updating to
14.1-RELEASE-p3:
/bin/freebsd-version
/rescue/[
...
/usr/src/sys/netpfil/pf/pf_lb.c
Installing updates...Scanning /usr/local/poudriere/jails/14release/usr/share/certs/untrusted for certificates...
Scanning /usr/local/poudriere/jails/14release/usr/share/certs/trusted for certificates...
 done.
14.1-RELEASE-p3
[00:00:45] Recording filesystem state for clean...cannot create snapshot 'tank/poudriere/jails/14release@clean': dataset already exists
 done

Expected behavior

It was unreasonable for me to update a jail that was running, I would expect poudriere to error out in this case.

Environment