# systemd template unit for the __NAME__ fleet — one instance per bot.
# install: cp deploy/ardegazu-__NAME__@.service /etc/systemd/system/
# mkdir -p /etc/ardegazu-__NAME__ (one <name>.json per instance)
# systemctl enable --now ardegazu-__NAME__@__NAME__
# A static user (not DynamicUser) so every instance and the trainer share the
# models/ checkpoint directory: useradd -r -s /usr/sbin/nologin ardegazu-__NAME__
[Unit]
Description=ardegazu suite bot __NAME__ (%i)
After=network-online.target
Wants=network-online.target
[Service]
User=ardegazu-__NAME__
Group=ardegazu-__NAME__
ExecStart=/usr/bin/node /opt/ardegazu-__NAME__/dist/main.js /etc/ardegazu-__NAME__/%i.json
StateDirectory=ardegazu-__NAME__/%i ardegazu-__NAME__/models
Environment=NODE_ENV=production
Restart=always
RestartSec=5
MemoryHigh=450M
MemoryMax=600M
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
[Install]
WantedBy=multi-user.target