From 0091b0c8270fb9ce283b497f2dbcaea92dd91995 Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Sun, 24 Sep 2023 10:30:32 +0000 Subject: [PATCH] Fix dbus, xserver and pulseudio startup errors --- docker/base/Dockerfile | 20 +++++++++++++++----- docker/base/dbus | 11 +++++++++++ docker/base/default.pa | 10 ++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 docker/base/dbus create mode 100644 docker/base/default.pa diff --git a/docker/base/Dockerfile b/docker/base/Dockerfile index ce2c507c..6d910abc 100644 --- a/docker/base/Dockerfile +++ b/docker/base/Dockerfile @@ -51,6 +51,10 @@ ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 ENV TZ UTC +ARG USERNAME=admin +ARG USER_UID=1000 +ARG USER_GID=${USER_UID} + # #Add dependencies # @@ -59,11 +63,17 @@ RUN apt-get update; \ apt-get install -y --no-install-recommends \ # #Xserver - wget ca-certificates xvfb dbus-user-session dbus-x11 libdbus-c++-1-0v5 xorg openbox\ + wget vim ca-certificates software-properties-common gpg-agent xvfb dbus-user-session dbus-x11 libdbus-c++-1-0v5\ # #Pulseaudio pulseaudio libcairo2 libxcb1 libxrandr2 libxv1 libopus0 libvpx6; \ # + # workaround for an X11 problem: http://blog.tigerteufel.de/?p=476 + # + mkdir /tmp/.X11-unix; \ + chmod 1777 /tmp/.X11-unix; \ + chown $USERNAME /tmp/.X11-unix/; \ + # # Housekeeping # apt-get clean -y; \ @@ -77,10 +87,6 @@ RUN apt-get update; \ /usr/share/man/* \ /usr/share/local/* -ARG USERNAME=admin -ARG USER_UID=1000 -ARG USER_GID=${USER_UID} - # #Create a non-root user `admin` # @@ -143,6 +149,10 @@ STOPSIGNAL SIGRTMIN+3 COPY temp/warp /usr/bin/ COPY docker/base/ffmpeg.sh /scripts/ RUN chmod +x /scripts/ffmpeg.sh /usr/bin/warp + +COPY docker/base/dbus /usr/bin/dbus +COPY docker/base/default.pa /etc/pulse/ + # #Copy the systemd.service file for starting the server # diff --git a/docker/base/dbus b/docker/base/dbus new file mode 100644 index 00000000..2859a0e2 --- /dev/null +++ b/docker/base/dbus @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ ! -d /var/run/dbus ]; then + mkdir -p /var/run/dbus +fi + +if [ -f /var/run/dbus/pid ]; then + rm -f /var/run/dbus/pid +fi + +/usr/bin/dbus-daemon --nofork --print-pid --config-file=/usr/share/dbus-1/system.conf \ No newline at end of file diff --git a/docker/base/default.pa b/docker/base/default.pa new file mode 100644 index 00000000..077021de --- /dev/null +++ b/docker/base/default.pa @@ -0,0 +1,10 @@ +#!/usr/bin/pulseaudio -nF + +### Create virtual output device sink +load-module module-null-sink sink_name=audio_output sink_properties=device.description="Virtual\ Audio\ Output" + +# Allow pulse audio to be accessed via TCP (from localhost only), to allow other users to access the virtual devices +load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket auth-anonymous=1 + +### Make sure we always have a sink around, even if it is a null sink. +load-module module-always-sink \ No newline at end of file