Page MenuHomeFreeBSD

etcupdate: Gracefully handle SIGINT when building trees.
ClosedPublic

Authored by jhb on Apr 19 2021, 9:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 3:24 AM
Unknown Object (File)
Mon, Apr 15, 9:43 PM
Unknown Object (File)
Thu, Apr 11, 6:49 PM
Unknown Object (File)
Tue, Apr 9, 8:21 PM
Unknown Object (File)
Wed, Apr 3, 7:51 AM
Unknown Object (File)
Mar 22 2024, 10:37 PM
Unknown Object (File)
Mar 22 2024, 10:37 PM
Unknown Object (File)
Mar 22 2024, 10:37 PM
Subscribers

Details

Summary

Run the 'build_tree' function inside of a subshell and trap SIGINT to
return an error to the caller. This allows callers to gracefully
cleanup a partially created tree.

While here, redirect stdout/stderr of the subshell to the log file
instead of applying redirections individually to each command executed
while building the tree.

MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb requested review of this revision.Apr 19 2021, 9:20 PM

oh, I think this does what my thought in another review suggested...

This revision is now accepted and ready to land.Apr 19 2021, 9:30 PM
usr.sbin/etcupdate/etcupdate.sh
182

Aren't you trapping SIGINT below? :)

usr.sbin/etcupdate/etcupdate.sh
182

Bah, I fat fingered when I updated this comment.

s/SIGQUIT/SIGINT/ in comment.

This revision now requires review to proceed.Apr 19 2021, 10:38 PM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 20 2021, 8:24 PM
This revision was automatically updated to reflect the committed changes.