Update start-stop-status to add gomemlimit

Signed-off-by: Brennen Smith <4530934+brennentsmith@users.noreply.github.com>
pull/17897/head
Brennen Smith 4 weeks ago committed by GitHub
parent 124301fbb6
commit 332f9c6b1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -28,6 +28,13 @@ if [ "${SYNOPKG_DSM_VERSION_MAJOR}" -eq "6" ]; then
chown -R tailscale:tailscale "${PKGVAR}/"
fi
# for smaller synology units with less than 512MB of memory, set a GOMEMLIMIT for all child processes
# to 128MiB to prevent constant swapping.
MEM_TOTAL_KB=$(awk '/MemTotal:/ { print $2 }' /proc/meminfo)
if [ "$MEM_TOTAL_KB" -lt 524288 ]; then
export GOMEMLIMIT=128MiB
fi
start_daemon() {
local ts=$(date --iso-8601=second)
echo "${ts} Starting ${SERVICE_NAME} with: ${SERVICE_COMMAND}" >${LOG_FILE}

Loading…
Cancel
Save