forked from rayclaw/rayclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrayclaw.service.example
More file actions
65 lines (56 loc) · 1.65 KB
/
rayclaw.service.example
File metadata and controls
65 lines (56 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# RayClaw systemd service — Ubuntu example
#
# Install:
# sudo cp rayclaw.service.example /etc/systemd/system/rayclaw.service
# sudo systemctl daemon-reload
# sudo systemctl enable --now rayclaw
#
# Before starting, make sure:
# 1. The binary exists at the ExecStart path
# 2. rayclaw.config.yaml is in WorkingDirectory
# 3. The log file is writable:
# sudo touch /var/log/rayclaw.log
# sudo chown YOUR_USER:YOUR_USER /var/log/rayclaw.log
[Unit]
Description=RayClaw AI Bot
Documentation=https://github.com/rayclaw/rayclaw
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=YOUR_USER
Group=YOUR_USER
WorkingDirectory=/opt/rayclaw
ExecStart=/opt/rayclaw/target/release/rayclaw start
# ── Restart policy ──
Restart=always
RestartSec=3
# Give up after 5 consecutive failures within 60s
StartLimitIntervalSec=60
StartLimitBurst=5
# ── Logging ──
StandardOutput=append:/var/log/rayclaw.log
StandardError=append:/var/log/rayclaw.log
# ── Environment ──
Environment=RUST_LOG=info
Environment=HOME=/home/YOUR_USER
# Uncomment to use a custom config path:
# Environment=RAYCLAW_CONFIG=/etc/rayclaw/config.yaml
# ── Graceful shutdown ──
# RayClaw listens for SIGTERM/SIGHUP and drains for 2s
KillSignal=SIGTERM
TimeoutStopSec=10
# ── Resource limits ──
LimitNOFILE=65536
LimitNPROC=4096
# ── Security hardening ──
NoNewPrivileges=true
ProtectHome=read-only
ProtectSystem=strict
# Allow writes to data dir, working dir, and log
ReadWritePaths=/opt/rayclaw/rayclaw.data
ReadWritePaths=/opt/rayclaw/tmp
ReadWritePaths=/var/log/rayclaw.log
PrivateTmp=true
[Install]
WantedBy=multi-user.target