Fix overlay service permission issue by running as root for shared volume access
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 22s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 22s
This commit is contained in:
@@ -246,8 +246,20 @@ class ScoreOverlayService:
|
||||
|
||||
# Initialize overlay text
|
||||
court_name = os.getenv('COURT_NAME', f'Court {self.court_number}')
|
||||
with open('/tmp/score.txt', 'w') as f:
|
||||
f.write(f"{court_name} - Waiting for match...")
|
||||
try:
|
||||
# Create file with write permissions for all
|
||||
with open('/tmp/score.txt', 'w') as f:
|
||||
f.write(f"{court_name} - Waiting for match...")
|
||||
os.chmod('/tmp/score.txt', 0o666)
|
||||
except PermissionError:
|
||||
# If file exists and we can't write, try to remove and recreate
|
||||
try:
|
||||
os.remove('/tmp/score.txt')
|
||||
with open('/tmp/score.txt', 'w') as f:
|
||||
f.write(f"{court_name} - Waiting for match...")
|
||||
os.chmod('/tmp/score.txt', 0o666)
|
||||
except:
|
||||
logger.error("Cannot create score.txt file - check permissions")
|
||||
|
||||
await self.cleanup_old_recordings()
|
||||
last_cleanup = datetime.now()
|
||||
|
Reference in New Issue
Block a user