Skip to content

Commit

Permalink
Fix DBus session
Browse files Browse the repository at this point in the history
  • Loading branch information
ehfd authored Jul 3, 2024
1 parent 5f903dd commit 6736f91
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,9 @@ ENV PIPEWIRE_RUNTIME_DIR="${PIPEWIRE_RUNTIME_DIR:-${XDG_RUNTIME_DIR:-/tmp}}"
ENV PULSE_RUNTIME_PATH="${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}"
ENV PULSE_SERVER="${PULSE_SERVER:-unix:${PULSE_RUNTIME_PATH:-${XDG_RUNTIME_DIR:-/tmp}/pulse}/native}"

# dbus-daemon to the below address is required during startup
ENV DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR:-/tmp}/dbus-session-${DISPLAY#*:}"

USER 1000
ENV SHELL=/bin/bash
ENV USER=ubuntu
Expand Down
21 changes: 17 additions & 4 deletions supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ serverurl=unix:///tmp/supervisor.sock
files = /etc/supervisor/conf.d/*.conf

[program:entrypoint]
command=bash -c "dbus-run-session -- /etc/entrypoint.sh"
command=bash -c "/etc/entrypoint.sh"
stdout_logfile=/tmp/entrypoint.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
Expand All @@ -37,6 +37,19 @@ autostart=true
autorestart=true
priority=1

[program:dbus]
command=bash -c "dbus-daemon --session --nosyslog --address=\"${DBUS_SESSION_BUS_ADDRESS}\""
environment=DISPLAY="%(ENV_DISPLAY)s",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",DBUS_SESSION_BUS_ADDRESS="%(ENV_DBUS_SESSION_BUS_ADDRESS)s"
stdout_logfile=/tmp/dbus.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
redirect_stderr=true
stopasgroup=true
stopsignal=INT
autostart=true
autorestart=true
priority=1

[program:selkies-gstreamer]
command=bash -c "if [ $(echo %(ENV_KASMVNC_ENABLE)s | tr '[:upper:]' '[:lower:]') != true ]; then /etc/selkies-gstreamer-entrypoint.sh; else sleep infinity; fi"
stdout_logfile=/tmp/selkies-gstreamer-entrypoint.log
Expand Down Expand Up @@ -79,7 +92,7 @@ priority=10

[program:pipewire]
command=bash -c "until [ -S \"/tmp/.X11-unix/X${DISPLAY#*:}\" ]; do sleep 0.5; done; /usr/bin/pipewire"
environment=PIPEWIRE_LATENCY="32/48000",DISPLAY=":0",DISABLE_RTKIT="y",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PIPEWIRE_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PULSE_RUNTIME_PATH="%(ENV_XDG_RUNTIME_DIR)s/pulse"
environment=PIPEWIRE_LATENCY="32/48000",DISPLAY="%(ENV_DISPLAY)s",DISABLE_RTKIT="y",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",DBUS_SESSION_BUS_ADDRESS="%(ENV_DBUS_SESSION_BUS_ADDRESS)s",PIPEWIRE_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PULSE_RUNTIME_PATH="%(ENV_XDG_RUNTIME_DIR)s/pulse"
stdout_logfile=/tmp/pipewire.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
Expand All @@ -91,7 +104,7 @@ autorestart=true

[program:wireplumber]
command=bash -c "until [ \"$(echo ${XDG_RUNTIME_DIR}/pipewire-*.lock)\" != \"${XDG_RUNTIME_DIR}/pipewire-*.lock\" ]; do sleep 0.5; done; /usr/bin/wireplumber"
environment=PIPEWIRE_LATENCY="32/48000",DISPLAY=":0",DISABLE_RTKIT="y",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PIPEWIRE_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PULSE_RUNTIME_PATH="%(ENV_XDG_RUNTIME_DIR)s/pulse"
environment=PIPEWIRE_LATENCY="32/48000",DISPLAY="%(ENV_DISPLAY)s",DISABLE_RTKIT="y",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",DBUS_SESSION_BUS_ADDRESS="%(ENV_DBUS_SESSION_BUS_ADDRESS)s",PIPEWIRE_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PULSE_RUNTIME_PATH="%(ENV_XDG_RUNTIME_DIR)s/pulse"
stdout_logfile=/tmp/wireplumber.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
Expand All @@ -103,7 +116,7 @@ autorestart=true

[program:pipewire-pulse]
command=bash -c "until [ \"$(echo ${XDG_RUNTIME_DIR}/pipewire-*.lock)\" != \"${XDG_RUNTIME_DIR}/pipewire-*.lock\" ]; do sleep 0.5; done; /usr/bin/pipewire-pulse"
environment=PIPEWIRE_LATENCY="32/48000",DISPLAY=":0",DISABLE_RTKIT="y",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PIPEWIRE_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PULSE_RUNTIME_PATH="%(ENV_XDG_RUNTIME_DIR)s/pulse"
environment=PIPEWIRE_LATENCY="32/48000",DISPLAY="%(ENV_DISPLAY)s",DISABLE_RTKIT="y",XDG_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",DBUS_SESSION_BUS_ADDRESS="%(ENV_DBUS_SESSION_BUS_ADDRESS)s",PIPEWIRE_RUNTIME_DIR="%(ENV_XDG_RUNTIME_DIR)s",PULSE_RUNTIME_PATH="%(ENV_XDG_RUNTIME_DIR)s/pulse"
stdout_logfile=/tmp/pipewire-pulse.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
Expand Down

0 comments on commit 6736f91

Please sign in to comment.