[Unit] Description=Foxhunt Data Service (Polygon.io Integration) After=network.target Requires=network.target Documentation=https://github.com/foxhunt/docs [Service] Type=exec User=foxhunt Group=foxhunt WorkingDirectory=/opt/foxhunt ExecStart=/opt/foxhunt/bin/foxhunt-data ExecReload=/bin/kill -HUP $MAINPID ExecStop=/bin/kill -TERM $MAINPID TimeoutStopSec=30 Restart=always RestartSec=5 # I/O optimized CPU cores CPUAffinity=12-15 SchedulingPolicy=normal SchedulingPriority=0 IOSchedulingClass=1 IOSchedulingPriority=2 # Memory for data buffering MemoryAccounting=yes MemoryMax=6G LimitNOFILE=65536 LimitMEMLOCK=infinity # Security NoNewPrivileges=true ProtectSystem=strict ProtectHome=true ProtectKernelTunables=true ProtectKernelModules=true ProtectControlGroups=true ReadWritePaths=/opt/foxhunt/data /var/log/foxhunt /tmp # Environment Environment=RUST_LOG=info Environment=FOXHUNT_CONFIG=/opt/foxhunt/config/production.toml Environment=POLYGON_API_KEY_FILE=/opt/foxhunt/secrets/polygon.key Environment=FOXHUNT_ENV=production [Install] WantedBy=multi-user.target