HomeFreeBSD

etcupdate: Always extract to a temporary tree.

Description

etcupdate: Always extract to a temporary tree.

etcupdate has had a somewhat nasty race condition since its creation
in that its state machine can get very confused if it is interrupted
while building the tree to compare against. This is exacerbated by
the fact that etcupdate doesn't emit any output while building the
tree which can take several seconds (especially in recent years with
the addition of the tree-wide buildconfig/installconfig passes).

To mitigate this, always install a new tree into a temporary directory
created via mktemp as was previously done only for dry-runs via -n.
The existing trees are only rotated and the new tree installed as
/var/db/etcupdate/current after the update command has completed.

Reported by: dim, np (and many others)
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D29843

(cherry picked from commit 0611aec3cf3a373e6a06f103699dbc91c3d6d472)
(cherry picked from commit b0df36580d5b0df67a0f58ded8f6356b268f7f71)

Details

Provenance
jhbAuthored on Apr 20 2021, 8:21 PM
Reviewer
imp
Differential Revision
D29843: etcupdate: Always extract to a temporary tree.
Parents
rGfe58db828934: pciconf: Fix up pciconf -lc output
Branches
Unknown
Tags
Unknown