Run with systemd
systemd is the easiest long-running deployment target for most Linux robots.
Recommended shape
- Install the engine in a stable location such as
/opt/gopherbot. - Create a dedicated robot home such as
/srv/robots/acme. - Create a dedicated Unix user for that robot.
- Put the robot’s
.envin the robot home with restrictive permissions. - Copy and adapt
resources/robot.serviceorresources/user-robot.service.
Minimal service pattern
[Service]
Type=simple
WorkingDirectory=/srv/robots/acme
ExecStart=/opt/gopherbot/gopherbot -plainlog
Restart=on-failure
TimeoutStopSec=600
Notes
- Keep the engine install tree and the robot home separate.
- The robot home should be writable by the robot user.
TimeoutStopSec=600is intentional; Gopherbot tries to finish in-flight pipelines during graceful shutdown.- Prefer configuring protocol and behavior in
custom/conf/and.envinstead of stuffing everything intoEnvironment=lines.
Bring it up
sudo systemctl daemon-reload
sudo systemctl enable acme-bot
sudo systemctl start acme-bot
sudo systemctl status acme-bot