From 18c8d8934599e159585a2249ffd2e32f6f7b4fa7 Mon Sep 17 00:00:00 2001 From: emrah Date: Tue, 20 Aug 2024 11:26:43 +0300 Subject: [PATCH] fix(sip-jibri): check SYS_ADMIN and /dev/shm before starting --- sip-jibri/rootfs/etc/cont-init.d/10-config | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sip-jibri/rootfs/etc/cont-init.d/10-config b/sip-jibri/rootfs/etc/cont-init.d/10-config index 5986846..efbfa53 100644 --- a/sip-jibri/rootfs/etc/cont-init.d/10-config +++ b/sip-jibri/rootfs/etc/cont-init.d/10-config @@ -1,5 +1,17 @@ #!/usr/bin/with-contenv bash +# Check if the SYS_ADMIN cap is set +if ! capsh --has-p=cap_sys_admin; then + echo "Required capability SYS_ADMIN is missing" + exit 1 +fi + +# Check if /dev/shm is large enough (2GB at least) +if ! shm-check; then + echo "/dev/shm must be at least 2GB in size" + exit 1 +fi + if [[ -z $SIP_JIBRI_XMPP_PASSWORD || -z $JIBRI_XMPP_PASSWORD ]]; then echo 'FATAL ERROR: Sip-Jibri XMPP password and auth password must be set' exit 1