Skip to content

Commit

Permalink
Merge pull request #197 from OpenVoiceOS/fix/potential_wrapper_race_c…
Browse files Browse the repository at this point in the history
…ondition

[ansible/venv] Fix potential wrapper race condition
  • Loading branch information
goldyfruit authored Oct 31, 2024
2 parents f3a140b + bb103de commit c1fe8ef
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ while ! [ -d "$combo_locks_path" ]; do
((attempt_counter++))
echo "Trying to start ovos-phal-admin systemd unit... Attempt ${attempt_counter}/${max_attempt}"
sleep 1
else
# If for some reasons /tmp/combo_locks is not created by the other
# services then we force the directory creation with the
# correct permissions to avoid a potential race condition.
if ! mkdir -p "$combo_locks_path"; then
echo "Failed to create $combo_locks_path directory" >&2
exit 1
fi
if ! chmod 755 "$combo_locks_path" || \
! chown -R {{ ovos_installer_user }}:{{ ovos_installer_group }} "$combo_locks_path"; then
echo "Failed to set permissions on $combo_locks_path" >&2
exit 1
fi
# Verify directory exists and has correct ownership
if [ ! -d "$combo_locks_path" ]; then
echo "Directory creation verification failed" >&2
exit 1
fi
fi
done

Expand Down

0 comments on commit c1fe8ef

Please sign in to comment.