Skip to content

Auto-Start on Boot

For always-on CI/CD, you’ll want your build agent to start automatically when your machine boots. FlightStack provides built-in commands to configure this.

Install the agent as a startup service:

Terminal window
flightstack agent install

Remove the startup service:

Terminal window
flightstack agent uninstall

That’s it! The CLI handles all platform-specific configuration.

On macOS, FlightStack uses launchd (Apple’s service management framework) to start the agent automatically.

Terminal window
flightstack agent install

This creates a Launch Agent plist at:

~/Library/LaunchAgents/com.flightstack.agent.plist

Output:

Installing FlightStack Agent as startup service...
Created: ~/Library/LaunchAgents/com.flightstack.agent.plist
✓ Agent installed as startup service!
The agent will start automatically on login.
To start now: launchctl start com.flightstack.agent
To stop: launchctl stop com.flightstack.agent
To uninstall: flightstack agent uninstall
Terminal window
# Start the service now (without rebooting)
launchctl start com.flightstack.agent
# Stop the service
launchctl stop com.flightstack.agent
# Check if running
launchctl list | grep flightstack

The generated plist includes:

  • RunAtLoad: Starts when you log in
  • KeepAlive: Restarts if the agent crashes
  • StandardOutPath: Logs to ~/.flightstack/agent.log
  • StandardErrorPath: Errors to ~/.flightstack/agent.error.log
Terminal window
flightstack agent uninstall

This stops the service and removes the plist file.

After installation, verify the startup service is configured:

Terminal window
# Check if plist exists
ls -la ~/Library/LaunchAgents/com.flightstack.agent.plist
# Check if loaded
launchctl list | grep flightstack
  1. Install the service

    Terminal window
    flightstack agent install
  2. Start it manually (to test without rebooting)

    Terminal window
    launchctl start com.flightstack.agent
  3. Verify it’s running

    Terminal window
    flightstack agent status
  4. Check in FlightStack app

    • Go to Build Agents
    • Verify your agent shows as “Online”
  5. Test reboot (optional)

    • Restart your computer
    • Verify agent starts automatically

When running as a service, logs are written to:

PlatformLog File
macOS~/.flightstack/agent.log
Linux~/.flightstack/agent.log or journalctl --user -u flightstack-agent
Windows%USERPROFILE%\.flightstack\agent.log

Check the logs for errors:

Terminal window
tail -100 ~/.flightstack/agent.log

Common issues:

  • Agent not registered (run flightstack agent register first)
  • Invalid token (re-register the agent)
  • Network issues (check connectivity)

You must register the agent before installing as a service:

Terminal window
flightstack agent register
flightstack agent install

If you see permission errors:

Terminal window
# Ensure LaunchAgents directory exists
mkdir -p ~/Library/LaunchAgents
# Check permissions
ls -la ~/Library/LaunchAgents/
Terminal window
# Reload systemd after manual changes
systemctl --user daemon-reload
# Check for errors
journalctl --user -u flightstack-agent --no-pager -n 50
  1. Open Task Scheduler
  2. Find FlightStackAgent
  3. Check the “Last Run Result” column
  4. Right-click > Properties > check configuration

When you update the FlightStack CLI, the startup service continues to work because it points to the executable. After updating:

  1. Stop the running agent
  2. Update the CLI
  3. Restart the agent (or reboot)
Terminal window
# Stop
flightstack agent stop
# Update (example for Homebrew)
brew upgrade flightstack
# Start
flightstack agent start

To stop the agent from starting automatically:

Terminal window
flightstack agent uninstall

This removes the startup configuration but keeps your agent registered. You can still start the agent manually with flightstack agent start.