Files
Hello/server/deploy/poorbird-worker.service

43 lines
986 B
Desktop File

[Unit]
Description=poorBird worker (job queue + scheduler)
After=network-online.target postgresql.service poorbird-api.service
Wants=network-online.target
Requires=postgresql.service
[Service]
Type=exec
User=poorbird
Group=poorbird
WorkingDirectory=/opt/poorbird/app
EnvironmentFile=/etc/poorbird/poorbird.env
# No ExecStartPre=migrate here: the API unit owns migrations, so two units
# never race to apply the same revision.
ExecStart=/opt/poorbird/venv/bin/poorbird worker
Restart=on-failure
RestartSec=5
# The worker finishes its current job on SIGTERM.
KillSignal=SIGTERM
TimeoutStopSec=60
StandardOutput=journal
StandardError=journal
SyslogIdentifier=poorbird-worker
# --- hardening
NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
RestrictSUIDSGID=yes
LockPersonality=yes
ReadWritePaths=/srv/poorbird /var/lib/poorbird
[Install]
WantedBy=multi-user.target