smartbotic-runner.service 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. [Unit]
  2. Description=SmartBotic Runner Service
  3. Documentation=https://github.com/smartbotic/smartbotic
  4. # Ordering only, deliberately not a Requires. The runner is built to survive
  5. # the webserver being absent - it retries node sync on reconnect_interval_ms
  6. # and re-registers on its heartbeat - so a hard requirement bought nothing even
  7. # when both ran on one host. It actively breaks a split deployment: with the
  8. # webserver on another machine the unit does not exist locally, and the runner
  9. # then refuses to start at all with "Unit smartbotic-webserver.service not
  10. # found". After= on a missing unit is simply ignored, which is what we want.
  11. After=network.target smartbotic-webserver.service
  12. # Without PartOf, "systemctl restart smartbotic.target" starts nothing and
  13. # stops nothing: a target is only a grouping, and restart/stop do not reach
  14. # its members through Wants alone. That silently leaves an old binary running
  15. # after a rebuild, with systemctl still reporting the target as active.
  16. PartOf=smartbotic.target
  17. [Service]
  18. Type=simple
  19. WorkingDirectory=/data/smartbotic
  20. # Add delay to ensure webserver is fully started before runner tries to register
  21. ExecStartPre=/bin/sleep 3
  22. ExecStart=/data/smartbotic/build/smartbotic-runner
  23. Restart=on-failure
  24. RestartSec=5
  25. StandardOutput=journal
  26. StandardError=journal
  27. # Environment
  28. Environment=LOG_LEVEL=info
  29. Environment=RUNNER_ID=runner-1
  30. Environment=NODES_PATH=/data/smartbotic/nodes
  31. # Resource limits
  32. LimitNOFILE=65536
  33. [Install]
  34. WantedBy=default.target