Service File
The systemd unit file is located atdeploy/oneclaw.service:
Service Configuration
Unit Section
- Description: Human-readable service name
- After: Starts after network and MQTT broker (if installed)
- Wants: Requires network availability
Service Section
Execution Settings
- Type=simple: Single long-running process (not forking)
- User/Group: Runs as dedicated
oneclawuser (not root) - WorkingDirectory: Base directory for config and data
- ExecStart: Path to OneClaw binary
Auto-Restart
- Restart=always: Automatically restarts on crashes or errors
- RestartSec=5: Waits 5 seconds before restarting (prevents tight restart loops)
Logging
journalctl).
Security Hardening
- NoNewPrivileges: Prevents privilege escalation
- ProtectSystem=strict: Read-only filesystem except
/opt/oneclaw - ProtectHome: Cannot access user home directories
- ReadWritePaths: Only
/opt/oneclawis writable - PrivateTmp: Isolated
/tmpdirectory
Resource Limits
- MemoryMax=128M: Maximum 128 MB RAM (edge-friendly)
- CPUQuota=50%: Maximum 50% of one CPU core
Environment Variables
- RUST_LOG: Sets logging level (
trace,debug,info,warn,error) - ONECLAW_WORKSPACE: Base directory for data and config
Installation Steps
Thedeploy/install.sh script automates systemd setup.
Automated Installation
Run installer
- Creates
/opt/oneclaw/directories - Creates
oneclawsystem user - Copies service file to
/etc/systemd/system/oneclaw.service - Reloads systemd daemon
Manual Installation
If installing manually:Service Management Commands
Start/Stop/Restart
Status and Health
Enable/Disable Auto-Start
Log Viewing
OneClaw logs to systemd journal:Live Logs (Tail)
Recent Logs
Log Filtering
Export Logs
Customizing the Service
Increase Resource Limits
If your device has more resources:Change Log Level
For more verbose logging:trace, debug, info, warn, error
Add API Keys
For cloud LLM providers:/opt/oneclaw/config/default.toml to avoid exposing in service file.
Delay Startup
Wait for other services:Uninstall Procedure
Thedeploy/uninstall.sh script removes OneClaw completely:
What It Does
Manual Uninstall
If uninstall script is unavailable:Troubleshooting
Service Won’t Start
Check status:- Binary missing: Verify
/opt/oneclaw/oneclaw-elderlyexists - Config syntax: Check
/opt/oneclaw/config/default.toml - Permissions: Ensure
oneclawuser owns/opt/oneclaw
Service Keeps Restarting
Check crash logs:- Missing API key
- Port conflict (MQTT, TCP)
- Database corruption (delete
/opt/oneclaw/data/oneclaw.db)
Out of Memory
Symptoms: Service killed by OOM killer Solutions:- Use smaller LLM model
- Increase
MemoryMaxin service file - Check for memory leaks:
journalctl -u oneclaw | grep -i memory
High CPU Usage
Check current usage:- Reduce
CPUQuotato limit impact - Optimize LLM inference (use smaller model)
- Check for runaway event loops in logs
Next Steps
Configuration
Customize OneClaw behavior and integrations
MQTT Channel
Connect IoT sensors and devices
Monitoring
Track performance and health metrics