Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions debian/jitsi-videobridge.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: jitsi-videobridge
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Jitsi Videobridge
# Description: WebRTC media server for Jitsi
### END INIT INFO

set -e

DAEMON=/usr/share/jitsi-videobridge/jvb.sh
NAME=jitsi-videobridge
DESC="Jitsi Videobridge"
PIDFILE=/var/run/$NAME.pid
CONFIG=/etc/jitsi/videobridge/config

[ -x "$DAEMON" ] || exit 0
[ -f "$CONFIG" ] && . "$CONFIG"

case "$1" in
start)
echo "Starting $DESC"
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--chuid jvb:jitsi \
--exec $DAEMON -- $JAVA_SYS_PROPS || true
;;
stop)
echo "Stopping $DESC"
start-stop-daemon --stop --quiet --pidfile $PIDFILE || true
;;
restart)
$0 stop
sleep 2
$0 start
;;
status)
if [ -f $PIDFILE ] && kill -0 $(cat $PIDFILE) 2>/dev/null; then
echo "$DESC is running"
else
echo "$DESC is not running"
exit 1
fi
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac

exit 0
3 changes: 2 additions & 1 deletion debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ ice4j {
# ensure videobridge is not running - it will be started at the end
if [ -d /run/systemd/system ]; then
systemctl stop jitsi-videobridge2.service >/dev/null || true
elif [ -x "/etc/init.d/jitsi-videobridge" ]; then
invoke-rc.d jitsi-videobridge stop || true
fi

# clean up old jvb group
Expand All @@ -180,7 +182,6 @@ ice4j {
exit 1
;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ override_dh_install:
dh_install

override_dh_installinit:
dh_installinit --noscripts
dh_installinit

override_dh_auto_install:
dh_auto_install
Expand Down
31 changes: 28 additions & 3 deletions jvb/resources/jvb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,32 @@ if [ -f $videobridge_rc ]; then
source $videobridge_rc
fi

if [ -z "$VIDEOBRIDGE_MAX_MEMORY" ]; then VIDEOBRIDGE_MAX_MEMORY=3072m; fi
if [ -z "$VIDEOBRIDGE_GC_TYPE" ]; then VIDEOBRIDGE_GC_TYPE=G1GC; fi
# Dynamically set max memory if not already defined
if [ -z "$VIDEOBRIDGE_MAX_MEMORY" ]; then
TOTAL_MEM=$(free -m 2>/dev/null | awk '/Mem:/ {print $2}')

exec java -Xmx$VIDEOBRIDGE_MAX_MEMORY $VIDEOBRIDGE_DEBUG_OPTIONS -XX:+Use$VIDEOBRIDGE_GC_TYPE -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -Djdk.tls.ephemeralDHKeySize=2048 $LOGGING_CONFIG_PARAM $JAVA_SYS_PROPS -cp $cp $mainClass $@
if [ -n "$TOTAL_MEM" ]; then
# Use 75% of total memory to avoid OOM on small setups
VIDEOBRIDGE_MAX_MEMORY=$(($TOTAL_MEM * 75 / 100))m
else
# Fallback value
VIDEOBRIDGE_MAX_MEMORY=1024m
fi
fi
if [ -z "$VIDEOBRIDGE_GC_TYPE" ]; then
VIDEOBRIDGE_GC_TYPE=G1GC;
fi


echo "Max memory that will be used: $VIDEOBRIDGE_MAX_MEMORY"

exec java -Xmx$VIDEOBRIDGE_MAX_MEMORY \
$VIDEOBRIDGE_DEBUG_OPTIONS \
-XX:+Use$VIDEOBRIDGE_GC_TYPE \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=/tmp \
-Djdk.tls.ephemeralDHKeySize=2048 \
$LOGGING_CONFIG_PARAM \
$JAVA_SYS_PROPS \
-cp $cp \
$mainClass "$@"
10 changes: 8 additions & 2 deletions jvb/src/main/kotlin/org/jitsi/videobridge/Endpoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,10 @@ class Endpoint @JvmOverloads constructor(
}
}
}
logger.error { "No properties found for SSRC $ssrc." }
logger.warn {
"No properties found for SSRC $ssrc in endpoint=$id, conference=${conference.id}. " +
"This may occur temporarily due to signaling delays or stream lifecycle timing."
}
return null
}

Expand All @@ -845,7 +848,10 @@ class Endpoint @JvmOverloads constructor(
else -> emptyList()
}.find { it.ssrc == ssrc }
}
logger.error { "No properties found for SSRC $ssrc." }
logger.warn {
"No properties found for SSRC $ssrc in endpoint=$id, conference=${conference.id}. " +
"This may occur temporarily due to signaling delays or stream lifecycle timing."
}
return null
}

Expand Down