EN·ES·DE·PT·FR
⌘K

Installation en tant que Service

Installez aidaemon en tant que service système qui démarre au boot et s'exécute en permanence.

Commande d'Installation

bash
./aidaemon install-service

Cela détecte automatiquement la plateforme et génère la configuration de service appropriée.

Linux (systemd)

Crée /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.target

Puis active et démarre le service :

bash
sudo systemctl daemon-reload
sudo systemctl enable --now aidaemon

macOS (launchd)

Crée $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>

Puis charge le service :

bash
launchctl load ~/Library/LaunchAgents/ai.aidaemon.plist
Empêcher la Mise en Veille macOS
macOS peut suspendre les processus en arrière-plan lorsque le système se met en veille. Pour garder aidaemon en fonctionnement continu, utilisez caffeinate :

caffeinate -s aidaemon

L'option -s empêche la mise en veille tant que le processus est en cours. Vous pouvez aussi utiliser caffeinate -i pour empêcher la mise en veille d'inactivité sans garder l'écran allumé. Si vous exécutez en tant que service launchd, ajoutez caffeinate -s avant le chemin du binaire dans les ProgramArguments de votre plist.

Vérification de Santé

Une fois en fonctionnement en tant que service, vérifiez avec :

bash
curl http://127.0.0.1:8080/health
# {"status": "ok"}

Le endpoint de santé est servi par axum sur le daemon.health_bind:daemon.health_port configuré.