Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opnsense-beep: serialize access to /dev/speaker #8281

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

darkk
Copy link

@darkk darkk commented Feb 3, 2025

Otherwise one of concurrent calls to `beep' might fail with error message "beep: open of /dev/speaker for writing: Device busy".

Locking is done in opnsense-beep and not in beep to preserve tune (avoid cacophony). ${BEEPDIR}/low is used as a lock-file as `low' beep is already a special file: it's default beep.

This might sound like a trivial change, but it might affect system behavior, e.g. when `opnsense-beep' is used in some shell script with errexit enabled.

Otherwise one of concurrent calls to `beep' might fail with error message
"beep: open of /dev/speaker for writing: Device busy".

Locking is done in `opnsense-beep' and not in `beep' to preserve tune (avoid
cacophony).  ${BEEPDIR}/low is used as a lock-file as `low' beep is already a
special file: it's default beep.

This might sound like a trivial change, but it might affect system behavior,
e.g. when `opnsense-beep' is used in some shell script with errexit enabled.
@fichtner fichtner self-assigned this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants