refactor: host pre-check probes its own socket path
The already-running check read the roster back only to learn the socket path cmd_host had computed a few lines earlier. The roster's presence still gates the probe: a leftover dir without one keeps falling through to the mkdir lock and its 'party clean' hint.
This commit is contained in:
parent
d51656c9e4
commit
8661d2968e
1 changed files with 3 additions and 7 deletions
10
party
10
party
|
|
@ -807,13 +807,9 @@ EOF
|
|||
echo "party: $party_dir exists and is not a directory you own" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -d "$party_dir" ] && [ -f "$rec" ]; then
|
||||
roster_read "$rec" 2>/dev/null || true
|
||||
if [ -n "${RR_SOCKET:-}" ] \
|
||||
&& [ "$(party_conn_state "$RR_SOCKET")" != dead ]; then
|
||||
echo "party: '$name' is already running" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [ -f "$rec" ] && [ "$(party_conn_state "$sock")" != dead ]; then
|
||||
echo "party: '$name' is already running" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# mkdir is the atomic acquisition primitive. POSIX mkdir(2) on an
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue