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)
Tue, Nov 12, 12:00 AM
Unknown Object (File)
Oct 16 2024, 6:32 PM
Unknown Object (File)
Oct 5 2024, 7:51 PM
Unknown Object (File)
Sep 23 2024, 12:26 PM
Unknown Object (File)
Sep 23 2024, 10:30 AM
Unknown Object (File)
Sep 22 2024, 9:11 AM
Unknown Object (File)
Sep 7 2024, 8:30 PM
Unknown Object (File)
Sep 7 2024, 5:03 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.