Overview
The service manager installs, starts, stops, and monitors the NullClaw gateway as a background daemon. Supported platforms:- macOS: launchd (LaunchAgents)
- Linux: systemd user services
- Windows: Service Control Manager (sc.exe)
Installation
1
Install service
- Auto-start on boot
- Auto-restart on failure
- Logging to ~/.nullclaw/logs/
2
Start service
3
Check status
Commands
Install
Start
Stop
Status
Uninstall
macOS (launchd)
On macOS, the service is installed as a LaunchAgent.Unit File Location
Configuration
Manual Management
Linux (systemd)
On Linux, the service is installed as a systemd user service.Unit File Location
Configuration
Manual Management
Windows (Service Control Manager)
On Windows, the service is installed usingsc.exe.
Service Name
Configuration
Manual Management
Auto-Start Configuration
All platforms enable auto-start by default:- macOS:
RunAtLoad=truein plist - Linux:
WantedBy=default.targetin unit file - Windows:
start=autoin service config
- On system boot
- On user login (systemd user services)
- After crash (auto-restart enabled)
Restart Behavior
macOS
Linux
Windows
Windows Service Manager does not auto-restart by default. Configure recovery actions:Logging
macOS
Logs are written to:Linux
Logs are captured by journald:Windows
Check Event Viewer:nullclaw
Environment Variables
Linux
The systemd unit file loads environment variables from:.env file:
EnvironmentFile=-... directive (with - prefix) makes the file optional.
macOS/Windows
Set environment variables in the service configuration or use the config file at~/.nullclaw/config.json.
Troubleshooting
Service won’t start (Linux)
Check if systemd user services are available:- Docker containers
- Minimal Linux distributions
- SSH sessions without lingering
Service stops after logout (Linux)
Systemd user services stop when the user session ends. Enable lingering:Permission denied (Windows)
Service installation requires administrator privileges. Run as administrator:Cannot find systemctl
Ifsystemctl is not available on Linux, you cannot use systemd user services. Run the gateway manually or use Docker.
Implementation
The service manager is implemented insrc/service.zig:
launchctl(macOS)systemctl(Linux)sc.exe(Windows)
~/workspace/source/src/service.zig for full implementation.