Files
cloudron-box/setup/start/systemd/box.service
Girish Ramakrishnan fb39aa32bb tasks: fix update failed notification
https://forum.cloudron.io/topic/13408/update-to-cloudron-8.3-error

We get a Task xx crashed with code null in the notification.

The crux of the issue is that we use KillMode=control-group. This ends
up sending SIGTERM signal to box code and all the sudo in parallel. The box
code then sees the sudo die and records the task as failed.

To fix, we switch to KillMode=mixed. This gives box code a chance to handle SIGTERM
first. It cleans out its task list and kills all the sudo.
2025-06-17 23:47:04 +02:00

33 lines
1.1 KiB
Desktop File

[Unit]
Description=Box
After=mysql.service nginx.service
; As cloudron-resize-fs is a one-shot, the Wants= automatically ensures that the service *finishes*
Wants=cloudron-resize-fs.service
[Install]
WantedBy=multi-user.target
[Service]
Type=idle
WorkingDirectory=/home/yellowtent/box
User=yellowtent
Group=yellowtent
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
; add "oidc-provider:*" to DEBUG for OpenID debugging
Environment="HOME=/home/yellowtent" "USER=yellowtent" "DEBUG=box:*,connect-lastmile,-box:ldap" "BOX_ENV=cloudron" "NODE_ENV=production" "LC_ALL=C"
; this sends the main process SIGTERM and then if anything lingers to the control-group . this is also the case if the main process crashes.
; the box code handles SIGTERM and cleanups the tasks
KillMode=mixed
KillSignal=SIGTERM
TimeoutStopSec=5s
SendSIGKILL=yes
; Do not kill this process on OOM. Children inherit this score. Do not set it to -1000 so that MemoryMax can keep working
OOMScoreAdjust=-999
MemoryMax=400M
StartLimitInterval=1
StartLimitBurst=60