Service Installation
Install aidaemon as a system service that starts on boot and runs forever.
Install Command
bash
./aidaemon install-serviceThis auto-detects the platform and generates the appropriate service configuration.
Linux (systemd)
Creates /etc/systemd/system/aidaemon.service:
aidaemon.service
[Unit]
Description=aidaemon AI Agent
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/full/path/to/aidaemon
WorkingDirectory=/path/to/config/dir
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.targetThen enables and starts the service:
bash
sudo systemctl daemon-reload
sudo systemctl enable --now aidaemonmacOS (launchd)
Creates $HOME/Library/LaunchAgents/ai.aidaemon.plist:
ai.aidaemon.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ai.aidaemon</string>
<key>ProgramArguments</key>
<array>
<string>/full/path/to/aidaemon</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/aidaemon.stdout.log</string>
<key>StandardErrorPath</key>
<string>/tmp/aidaemon.stderr.log</string>
</dict>
</plist>Then loads the service:
bash
launchctl load ~/Library/LaunchAgents/ai.aidaemon.plistPrevent macOS Sleep
macOS may suspend background processes when the system sleeps. To keep aidaemon running continuously, use
The
caffeinate:caffeinate -s aidaemonThe
-s flag prevents sleep while the process is running. You can also use caffeinate -i to prevent idle sleep without keeping the display on. If running as a launchd service, add caffeinate -s before the binary path in your plist ProgramArguments.Health Check
Once running as a service, verify with:
bash
curl http://127.0.0.1:8080/health
# {"status": "ok"}The health endpoint is served by axum on the configured daemon.health_bind:daemon.health_port.