2

I am trying to have my service account play a sound when a problem occurs, I have figured out how to get a script to run when I want to, but the problem is that the play command won't work. From the research that I did it seems that pulseaudio only works if you run it as the authenticated user, but I can't find anything about how to get around this. Does anyone know of a way to accomplish this?

Edit: I did a bunch more digging and ended up finding a solution for this, I'll post it here incase anyone stumbles onto this question with the same problem


Edit /etc/pulse/default.pa and put the following line on the bottom of the file:
load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/my-pulse-socket-name

Edit /etc/pulse/client.conf and put the following line at the end of the file: default-server = unix:/tmp/my-pulse-socket-name

You can now play audio from any user.

Eric
  • 31
  • 5

1 Answers1

1

I did a bunch more digging and ended up finding a solution for this, I'll post it here incase anyone stumbles onto this question with the same problem


Edit /etc/pulse/default.pa and put the following line on the bottom of the file:
load-module module-native-protocol-unix auth-anonymous=1 socket=/tmp/my-pulse-socket-name

Edit /etc/pulse/client.conf and put the following line at the end of the file: default-server = unix:/tmp/my-pulse-socket-name

You can now play audio from any user.

Eric
  • 31
  • 5