From 4426ed8f27b6cca680dedc20830f8f0c4f3575a6 Mon Sep 17 00:00:00 2001 From: netaskd Date: Thu, 23 Apr 2020 14:40:30 +0300 Subject: [PATCH] jibri: fix case when /dev/snd is not bound (https://github.com/jitsi/docker-jitsi-meet/issues/240#issuecomment-610422404) --- jibri/rootfs/etc/cont-init.d/10-config | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jibri/rootfs/etc/cont-init.d/10-config b/jibri/rootfs/etc/cont-init.d/10-config index 5ef0048..22891aa 100644 --- a/jibri/rootfs/etc/cont-init.d/10-config +++ b/jibri/rootfs/etc/cont-init.d/10-config @@ -26,7 +26,12 @@ fi && ( echo -e "\e[31mERROR: Please load snd-aloop module on the docker host.\e[39m"; kill 1; exit 1 ) # get host's audio group id -host_audio_group="$(stat -c %g /dev/snd/pcmC0D0p)" +host_audio_group="$(stat -c %g /dev/snd/pcmC0D0p 2>/dev/null)" + +# audio group is not found. Has it been run without jibri.yml? +[ -z "${host_audio_group}" ] \ +&& ( echo -e "\e[31mERROR: Binding /dev/snd is not found. Please check that you run docker-compose with -f jibri.yml.\e[39m"; kill 1; exit 1 ) + # try to create group with this id. If group with the id already exists, just skip groupadd -g ${host_audio_group} jibri-audio >/dev/null 2>&1 # include user to the group by id