pulseaudio: define runtime user-specific directory XDG_RUNTIME_DIR
This commit exports the environment variable XDG_RUNTIME_DIR if does not exists for services that require sharing a pulseaudio instance. Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
parent
9cd5ae591d
commit
3b99bf3821
|
|
@ -17,6 +17,8 @@ readonly DEMOSERVER_BINARY="/srv/www/demoserver.py"
|
||||||
readonly STOP_TIMEOUT="5"
|
readonly STOP_TIMEOUT="5"
|
||||||
readonly PULSEAUDIO_START_COMMAND="pulseaudio --start"
|
readonly PULSEAUDIO_START_COMMAND="pulseaudio --start"
|
||||||
|
|
||||||
|
[ -z "${XDG_RUNTIME_DIR}" ] && export XDG_RUNTIME_DIR=/run/user/$UID
|
||||||
|
|
||||||
stop_process() {
|
stop_process() {
|
||||||
# try to stop gracefully
|
# try to stop gracefully
|
||||||
pkill -f "${1}" >/dev/null 2>&1
|
pkill -f "${1}" >/dev/null 2>&1
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,11 @@
|
||||||
[ -f "/etc/profile.d/weston.sh" ] && source /etc/profile.d/weston.sh
|
[ -f "/etc/profile.d/weston.sh" ] && source /etc/profile.d/weston.sh
|
||||||
[ -f "/etc/X11/Xsession.d/13xdgbasedirs.sh" ] && source /etc/X11/Xsession.d/13xdgbasedirs.sh
|
[ -f "/etc/X11/Xsession.d/13xdgbasedirs.sh" ] && source /etc/X11/Xsession.d/13xdgbasedirs.sh
|
||||||
|
|
||||||
|
[ -z "${XDG_RUNTIME_DIR}" ] && export XDG_RUNTIME_DIR=/run/user/$UID
|
||||||
|
|
||||||
export DBUS_SESSION_BUS_ADDRESS=unix:path=${XDG_RUNTIME_DIR}/bus
|
export DBUS_SESSION_BUS_ADDRESS=unix:path=${XDG_RUNTIME_DIR}/bus
|
||||||
|
|
||||||
pulseaudio --start
|
pulseaudio --start --log-target=journal
|
||||||
|
|
||||||
# Create a symlink to the daemon's PID file in a more accesible directory
|
# Create a symlink to the daemon's PID file in a more accesible directory
|
||||||
ln -sf ${XDG_RUNTIME_DIR}/pulse/pid /run/pulse.pid
|
ln -sf ${XDG_RUNTIME_DIR}/pulse/pid /run/pulse.pid
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue