docker-unifi-network-applic.../root/etc/s6-overlay/s6-rc.d/svc-unifi-network-application/run

46 lines
1.8 KiB
Plaintext
Raw Normal View History

2023-09-05 09:07:14 -07:00
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
if [[ -z ${MEM_LIMIT} ]] || [[ ${MEM_LIMIT} = "default" ]]; then
MEM_LIMIT="1024"
fi
if [[ -z ${MEM_STARTUP} ]] || [[ ${MEM_STARTUP} = "default" ]]; then
exec \
s6-notifyoncheck -d -n 600 -w 1000 \
cd /config s6-setuidgid abc java \
-Xmx"${MEM_LIMIT}M" \
-Dlog4j2.formatMsgNoLookups=true \
-Dfile.encoding=UTF-8 \
-Djava.awt.headless=true \
-Dapple.awt.UIElement=true \
-XX:+UseParallelGC \
-XX:+ExitOnOutOfMemoryError \
-XX:+CrashOnOutOfMemoryError \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.time=ALL-UNNAMED \
--add-opens java.base/sun.security.util=ALL-UNNAMED \
--add-opens java.base/java.io=ALL-UNNAMED \
--add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED \
-jar /usr/lib/unifi/lib/ace.jar start;
else
exec \
s6-notifyoncheck -d -n 600 -w 1000 \
cd /config s6-setuidgid abc java \
-Xms"${MEM_STARTUP}M" \
-Xmx"${MEM_LIMIT}M" \
-Dlog4j2.formatMsgNoLookups=true \
-Dfile.encoding=UTF-8 \
-Djava.awt.headless=true \
-Dapple.awt.UIElement=true \
-XX:+UseParallelGC \
-XX:+ExitOnOutOfMemoryError \
-XX:+CrashOnOutOfMemoryError \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.time=ALL-UNNAMED \
--add-opens java.base/sun.security.util=ALL-UNNAMED \
--add-opens java.base/java.io=ALL-UNNAMED \
--add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED \
-jar /usr/lib/unifi/lib/ace.jar start;
fi