BastilleBSD / bastille

Bastille is an open-source system for automating deployment and management of containerized applications on FreeBSD.
https://bastillebsd.org
BSD 3-Clause "New" or "Revised" License
823 stars 130 forks source link

[BUG] upgrade and update commands rely on broken semantics of freebsd-update which might lead to broken jails #658

Open michael-o opened 9 months ago

michael-o commented 9 months ago

Describe the bug Both commands ugprade and update use freebsd-update(8) to update releases and thick jails. Unfortunately, they assume that freebsd-update will rebase all commands on top of the basedir passed, thus fully isolate all operations. It does not. The command is broken in this regard.

See:

It pollutes the jailhost and uses potentially wrong config.

Sources:

Bastille and FreeBSD version (paste bastille -v && freebsd-version -kru output) 0.10.20231013 13.2-STABLE 13.2-STABLE 13.2-STABLE

How did you install bastille? (port/pkg/git) port

Expected behavior For release updates/upgrades:

For thick jail updates/upgrades:

Additional context Gladly, I have tested the upgrade in a separate host where the jails were shredded. I will refrain from using bastille update/upgrade for now. If desired, I can provide a PR for this.

michael-o commented 9 months ago

These worked for me instead:

michael-o commented 9 months ago

FTR: Poudriere properly isolates jail updates: https://github.com/freebsd/poudriere/blob/f2d23984f54b56cb8377302e2deb6ee357d725a2/src/share/poudriere/jail.sh#L293-L303

michael-o commented 8 months ago

Improvement upstream: https://reviews.freebsd.org/D43700

michael-o commented 3 months ago

Improvement upstream: https://reviews.freebsd.org/D43700

This has been merged upstream.