You are not logged in.

#1 2015-04-03 14:19:18

yorrd
Member
Registered: 2013-07-21
Posts: 71

pactl not being able to run through sudo

I'm trying to get the sink-inputs of a different user.

pactl list sink-inputs
--> works

sudo -u myuser pactl list sink-inputs
--> gives me the error below

Connection failure: Connection refused
pa_context_connect() failed: Connection refused

Any idea on how I could work around this? I need to do this because I have a script (php) run as the http user, but I need the input-sinks of my current user

Offline

#2 2015-10-09 15:23:08

Jonhoo
Member
Registered: 2009-05-23
Posts: 118

Re: pactl not being able to run through sudo

To save other people arriving at this from a lot of headache, the reason this doesn't work is that you also need to set XDG_RUNTIME_DIR:

sudo -u myuser env XDG_RUNTIME_DIR=/run/user/$(id -u myuser) pactl ...

Offline

Board footer

Powered by FluxBB