ironclaw service
Manage IronClaw as an OS service. This allows the agent to run in the background and start automatically on system boot.- macOS: Uses
launchd - Linux: Uses
systemd
Subcommands
install- Install the OS servicestart- Start the servicestop- Stop the servicestatus- Show service statusuninstall- Uninstall the service
ironclaw service install
Install IronClaw as an OS service.Syntax
Description
This command:- Detects your operating system (macOS or Linux)
- Generates the appropriate service configuration file
- Installs the service unit file
- Configures the service to start on boot
ironclaw run with your current configuration.
macOS (launchd)
Creates:~/Library/LaunchAgents/com.ironclaw.agent.plist
Linux (systemd)
Creates:~/.config/systemd/user/ironclaw.service
Examples
Output
macOS:ironclaw service start
Start the IronClaw service.Syntax
Examples
Output
macOS:ironclaw service stop
Stop the running IronClaw service.Syntax
Examples
Output
macOS:ironclaw service status
Show the current status of the IronClaw service.Syntax
Examples
Output
macOS (running):ironclaw service uninstall
Uninstall the IronClaw service and remove service files.Syntax
Description
This command:- Stops the service if running
- Unloads/disables the service
- Removes the service configuration file
Examples
Output
macOS:Service Logs
macOS (launchd)
Logs are written to:- Standard output:
~/.ironclaw/service.log - Standard error:
~/.ironclaw/service-error.log
Linux (systemd)
Logs are managed by journald:~/.ironclaw/service.log~/.ironclaw/service-error.log
Environment Variables
The service inherits environment variables from:- System environment (limited in service context)
- User environment (shell profile not loaded)
.envfile in the working directory
Setting Service Environment
macOS (launchd): Edit~/Library/LaunchAgents/com.ironclaw.agent.plist:
~/.config/systemd/user/ironclaw.service:
Working Directory
The service runs in the directory whereironclaw is installed. To specify a different working directory:
macOS (launchd):
Restart Behavior
macOS (launchd)
The service automatically restarts if it crashes:<false/>.
Linux (systemd)
The service restarts after 10 seconds if it fails:Troubleshooting
Service won’t start
Check logs:- Missing environment variables
- Database connection failure
- Permission errors
Service starts but stops immediately
Check for:- Configuration errors
- Missing dependencies
- Port conflicts
Environment variables not working
The service doesn’t load your shell profile (.bashrc, .zshrc, etc.).
Options:
- Set environment variables in the service unit file (see above)
- Use a
.envfile in the working directory - Specify
EnvironmentFilein systemd service