fix: a signal during party host rolls back and stops

The rollback trap was armed on EXIT INT TERM HUP with a body that did
not exit. After a signal the shell ran the cleanup, then resumed
cmd_host and kept configuring the party dir it had just removed.
Keep the cleanup on EXIT and make the signal traps exit with the
conventional 128+n status.
This commit is contained in:
veg 2026-09-21 09:32:01 +00:00
parent 6c48777553
commit 851cef6941
2 changed files with 26 additions and 1 deletions

9
party
View file

@ -796,10 +796,17 @@ EOF
# mkdir race tear down the winner's directory and tmux server via
# set -e + EXIT trap. Now the trap fires only on resources this
# process actually created. Disarmed once roster_write commits.
#
# The cleanup hangs off EXIT alone; the signal traps only exit. A
# signal trap body that returns lets the shell resume where it was
# interrupted, which here means configuring a dir we just removed.
trap '
"$PARTY_TMUX" -S "$sock" kill-server 2>/dev/null || true
rm -rf "$party_dir"
' EXIT INT TERM HUP
' EXIT
trap 'exit 129' HUP
trap 'exit 130' INT
trap 'exit 143' TERM
chgrp "$TMUX_PARTY_GROUP" "$party_dir"
chmod 0750 "$party_dir"