Skip to main content

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 service
  • start - Start the service
  • stop - Stop the service
  • status - Show service status
  • uninstall - Uninstall the service

ironclaw service install

Install IronClaw as an OS service.

Syntax

Description

This command:
  1. Detects your operating system (macOS or Linux)
  2. Generates the appropriate service configuration file
  3. Installs the service unit file
  4. Configures the service to start on boot
The service will run 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:
Linux:

ironclaw service start

Start the IronClaw service.

Syntax

Examples

Output

macOS:
Linux:

ironclaw service stop

Stop the running IronClaw service.

Syntax

Examples

Output

macOS:
Linux:

ironclaw service status

Show the current status of the IronClaw service.

Syntax

Examples

Output

macOS (running):
macOS (stopped):
Linux (running):
Linux (stopped):

ironclaw service uninstall

Uninstall the IronClaw service and remove service files.

Syntax

Description

This command:
  1. Stops the service if running
  2. Unloads/disables the service
  3. Removes the service configuration file

Examples

Output

macOS:
Linux:

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:
Logs are also written to:
  • ~/.ironclaw/service.log
  • ~/.ironclaw/service-error.log

Environment Variables

The service inherits environment variables from:
  1. System environment (limited in service context)
  2. User environment (shell profile not loaded)
  3. .env file in the working directory

Setting Service Environment

macOS (launchd): Edit ~/Library/LaunchAgents/com.ironclaw.agent.plist:
Reload:
Linux (systemd): Edit ~/.config/systemd/user/ironclaw.service:
Reload:

Working Directory

The service runs in the directory where ironclaw is installed. To specify a different working directory: macOS (launchd):
Linux (systemd):

Restart Behavior

macOS (launchd)

The service automatically restarts if it crashes:
To disable auto-restart, edit the plist and set to <false/>.

Linux (systemd)

The service restarts after 10 seconds if it fails:
To disable auto-restart:

Troubleshooting

Service won’t start

Check logs:
Common issues:
  • Missing environment variables
  • Database connection failure
  • Permission errors
Test manually first:

Service starts but stops immediately

Check for:
  • Configuration errors
  • Missing dependencies
  • Port conflicts
Run diagnostics:

Environment variables not working

The service doesn’t load your shell profile (.bashrc, .zshrc, etc.). Options:
  1. Set environment variables in the service unit file (see above)
  2. Use a .env file in the working directory
  3. Specify EnvironmentFile in systemd service

Permission denied (Linux)

Ensure the service file is readable:
Reload systemd:

Service not starting on boot (Linux)

Enable lingering for your user:
Verify the service is enabled:

Manual Service Management

macOS (launchd)

Linux (systemd)

  • onboard - Initial configuration
  • doctor - Verify configuration and dependencies
  • config - View and modify settings