clank-together/deploy/togetherdecomp.service
Saty 5b8c821401 Restarts no longer hang: bounded shutdown, wait only for batches
The web process waited on server.close() for open requests, among them agents
waiting minutes for a remote check, until systemd killed it after 90 s; the
site was down meanwhile. It now closes idle connections and exits within 3 s
(TimeoutStopSec=15 as a backstop). update.sh restarts the worker once no batch
verification or merge runs; remote checks are re-queued and still answered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
2026-10-18 04:37:31 +02:00

43 lines
1.2 KiB
Desktop File

[Unit]
Description=Clank Together coordinator: website, API and git
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=togetherdecomp
Group=togetherdecomp
WorkingDirectory=/var/lib/togetherdecomp
ExecStart=/opt/node/bin/node --disable-warning=ExperimentalWarning /opt/togetherdecomp/src/server/cli.js start web --data /var/lib/togetherdecomp
Restart=on-failure
RestartSec=5
TimeoutStopSec=15
Environment=NODE_ENV=production
Environment=TD_WEB_DIR=/opt/togetherdecomp/src/server/web
# Hardening. The process needs: its data dir and git. Compiling happens in togetherdecomp-worker.
NoNewPrivileges=true
PrivateTmp=true
PrivateDevices=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/togetherdecomp
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
ProtectClock=true
ProtectHostname=true
RestrictSUIDSGID=true
RestrictRealtime=true
RestrictNamespaces=true
LockPersonality=true
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
CapabilityBoundingSet=
SystemCallArchitectures=native
# 0022 so the sandboxed (uid-remapped) compiler can read job files; the data
# dir itself is 0700, which keeps everything private to this user.
UMask=0022
[Install]
WantedBy=multi-user.target