diff --git a/setup/start/systemd/box.service b/setup/start/systemd/box.service index 963281f92..31e7cb01f 100644 --- a/setup/start/systemd/box.service +++ b/setup/start/systemd/box.service @@ -14,7 +14,7 @@ Restart=always ExecStart=/home/yellowtent/box/box.js ExecReload=/bin/kill -HUP $MAINPID ; we run commands like df which will parse properly only with correct locale -Environment="HOME=/home/yellowtent" "USER=yellowtent" "DEBUG=box:*,connect-lastmile,-box:ldap" "BOX_ENV=cloudron" "NODE_ENV=production" "LC_ALL=C" +Environment="HOME=/home/yellowtent" "USER=yellowtent" "DEBUG=box:*,connect-lastmile,-box:ldap" "BOX_ENV=cloudron" "NODE_ENV=production" "LC_ALL=C" "AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE=1" ; kill apptask processes as well KillMode=control-group ; Do not kill this process on OOM. Children inherit this score. Do not set it to -1000 so that MemoryMax can keep working diff --git a/src/scripts/starttask.sh b/src/scripts/starttask.sh index 86f78d1a2..d2035ee55 100755 --- a/src/scripts/starttask.sh +++ b/src/scripts/starttask.sh @@ -45,7 +45,7 @@ fi # DEBUG has to be hardcoded because it is not set in the tests. --setenv is required for ubuntu 16 (-E does not work) # NODE_OPTIONS is used because env -S does not work in ubuntu 16/18. # it seems systemd-run does not return the exit status of the process despite --wait -if ! systemd-run --unit "${service_name}" --nice "${nice}" --uid=${id} --gid=${id} ${options} --setenv HOME=${HOME} --setenv USER=${SUDO_USER} --setenv DEBUG=box:* --setenv BOX_ENV=${BOX_ENV} --setenv NODE_ENV=production --setenv NODE_OPTIONS=--unhandled-rejections=strict "${task_worker}" "${task_id}" "${logfile}"; then +if ! systemd-run --unit "${service_name}" --nice "${nice}" --uid=${id} --gid=${id} ${options} --setenv HOME=${HOME} --setenv USER=${SUDO_USER} --setenv DEBUG=box:* --setenv BOX_ENV=${BOX_ENV} --setenv NODE_ENV=production --setenv NODE_OPTIONS=--unhandled-rejections=strict --setenv AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE=1 "${task_worker}" "${task_id}" "${logfile}"; then echo "Service ${service_name} failed to run" # this only happens if the path to task worker itself is wrong fi