Hi,
I am trying to run an application via systemd. This application tries to consume the audio system to emit some sounds.
When i run it from a terminal under my (current) user, everything works fine, although, when i configure it to run via systemd, it fails to connect to the pulse audio service and the sounds are not emitted.
This is my error message:
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused
The underlying library to enable sounds is GitHub - faiface/beep: A little package that brings sound to any Go application. Suitable for playback and audio-processing.
The unit is
[Unit]
Description=Cucumber service.
[Service]
Type=simple
Restart=always
RestartSec=3
StartLimitIntervalSec=360
ExecStart=/home/mh-cbon/cucumber/cucumber
User=mh-cbon
Group=mh-cbon
WorkingDirectory=/home/mh-cbon/cucumber
[Install]
WantedBy=multi-user.target
$ groups mh-cbon
mh-cbon : mh-cbon lp docker
I tried to set the unit group as audio, that did not fix the problem. I would like not to have to add my user to audio group, if that would solve the issue.
Any idea what is going on ?
thank you for your help and inputs, it is appreciated.