Skip to content

Commit 11e9a68

Browse files
committed
Add workaround for Wowza's ldconfig shenanigans
1 parent 52c2f0d commit 11e9a68

3 files changed

Lines changed: 79 additions & 2 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ COPY --chown=$APP_USER WowzaStreamingEngine /usr/local/WowzaStreamingEngine
112112
COPY --chown=$APP_USER log4j-templates /opt/app/log4j-templates
113113
COPY --chown=$APP_USER supervisor_templates /opt/app/supervisor_templates
114114
COPY --chown=$APP_USER bin /opt/app/bin
115+
COPY sbin/wowza-entrypoint.sh /sbin
115116

116117
# create supervisord config files from templates
117118
RUN apt-get install -y --no-install-recommends gettext

bin/docker-entrypoint.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export WSE_LIC=$WOWZA_LICENSE_KEY
3333

3434
# ########################################
3535
# Start server and manager by handing off to Wowza's entrypoint
36+
# Note: see notes in sbin/wowza-entrypoint.sh; this is our workaround
37+
# for the NVIDIA nonsense they're trying to enable
3638

37-
echo Invoking Wowza\'s /sbin/entrypoint.sh
38-
exec /sbin/entrypoint.sh "$@"
39+
echo Invoking Wowza\'s entrypoint
40+
exec /sbin/wowza-entrypoint.sh "$@"

sbin/wowza-entrypoint.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
3+
# This is the Wowza entrypoint script as of 4.9.7+11; we're disabling
4+
# the NVIDIA drivers because running ldconfig as an unprivileged user
5+
# doesn't work.
6+
7+
# Begin Section to map NVIDIA specific libraries for EVA
8+
9+
set -e
10+
11+
log() {
12+
echo "[entrypoint][$(date '+%Y-%m-%d %H:%M:%S')] $*" >&2
13+
}
14+
15+
LIB_DIR="/usr/lib/x86_64-linux-gnu"
16+
17+
if [ -d "$LIB_DIR" ]; then
18+
# [ -f "${LIB_DIR}/libnvidia-encode.so.1" ] && \
19+
# ln -sf "${LIB_DIR}/libnvidia-encode.so.1" "${LIB_DIR}/libnvidia-encode.so"
20+
21+
# [ -f "${LIB_DIR}/libnvcuvid.so.1" ] && \
22+
# ln -sf "${LIB_DIR}/libnvcuvid.so.1" "${LIB_DIR}/libnvcuvid.so"
23+
24+
# ldconfig
25+
# log "NVIDIA symlinks installed, starting original service"
26+
log "SKIPPING NVIDIA symlinks installation"
27+
28+
fi
29+
30+
# End Section to map NVIDIA specific libraries for EVA
31+
32+
WMSAPP_HOME="$( readlink /usr/local/WowzaStreamingEngine )"
33+
34+
if [ -z $WSE_MGR_USER ]; then
35+
mgrUser="wowza"
36+
else
37+
mgrUser=$WSE_MGR_USER
38+
fi
39+
if [ -z $WSE_MGR_PASS ]; then
40+
mgrPass="wowza"
41+
else
42+
mgrPass=$WSE_MGR_PASS
43+
fi
44+
45+
if [ ! -z $WSE_LIC ]; then
46+
cat > ${WMSAPP_HOME}/conf/Server.license <<EOF
47+
-----BEGIN LICENSE-----
48+
${WSE_LIC}
49+
-----END LICENSE-----
50+
EOF
51+
fi
52+
53+
echo -e "\n$mgrUser $mgrPass admin|advUser\n" >> ${WMSAPP_HOME}/conf/admin.password
54+
echo -e "\n$mgrUser $mgrPass\n" >> ${WMSAPP_HOME}/conf/publish.password
55+
echo -e "\n$mgrUser $mgrPass\n" >> ${WMSAPP_HOME}/conf/jmxremote.password
56+
#echo -e "$mgrUser readwrite\n" >> ${WMSAPP_HOME}/conf/jmxremote.access
57+
58+
if [[ ! -z $WSE_IP_PARAM ]]; then
59+
#change localhost to some user defined IP
60+
cat "${WMSAPP_HOME}/conf/Server.xml" > serverTmp
61+
sed 's|\(<IpAddress>localhost</IpAddress>\)|<IpAddress>'"$WSE_IP_PARAM"'</IpAddress> <!--changed for default install. \1-->|' <serverTmp >Server.xml
62+
sed 's|\(<RMIServerHostName>localhost</RMIServerHostName>\)|<RMIServerHostName>'"$WSE_IP_PARAM"'</RMIServerHostName> <!--changed for default install. \1-->|' <Server.xml >serverTmp
63+
cat serverTmp > ${WMSAPP_HOME}/conf/Server.xml
64+
rm serverTmp Server.xml
65+
66+
cat "${WMSAPP_HOME}/conf/VHost.xml" > vhostTmp
67+
sed 's|\(<IpAddress>${com.wowza.wms.HostPort.IpAddress}</IpAddress>\)|<IpAddress>'"$WSE_IP_PARAM"'</IpAddress> <!--changed for default cloud install. \1-->|' <vhostTmp >${WMSAPP_HOME}/conf/VHost.xml
68+
rm vhostTmp
69+
fi
70+
71+
# Make supervisor log files configurable
72+
#sed 's|^logfile=.*|logfile='"${SUPERVISOR_LOG_HOME}"'/supervisor/supervisord.log ;|' -i /etc/supervisor/supervisord.conf
73+
74+
exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf

0 commit comments

Comments
 (0)