2026-05-06 01:04:47 -07:00
|
|
|
# IAI-MCP Sleep Daemon -- systemd user unit (Plan 04-01, DAEMON-01)
|
|
|
|
|
#
|
|
|
|
|
# Install at ~/.config/systemd/user/iai-mcp-daemon.service, then:
|
|
|
|
|
# systemctl --user daemon-reload
|
|
|
|
|
# systemctl --user enable --now iai-mcp-daemon.service
|
|
|
|
|
#
|
|
|
|
|
# For survival past logout (headless servers):
|
|
|
|
|
# loginctl enable-linger $USER
|
|
|
|
|
#
|
|
|
|
|
# C3 / guard: NO paid-API env var in Environment= lines. host_cli.py
|
|
|
|
|
# scrubs the subprocess env at spawn time; the unit env is intentionally minimal.
|
|
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
|
Description=IAI-MCP Sleep Daemon -- autonomous neural consolidation between sessions
|
|
|
|
|
After=default.target
|
2026-05-14 16:20:54 +02:00
|
|
|
StartLimitIntervalSec=60
|
|
|
|
|
StartLimitBurst=3
|
2026-05-06 01:04:47 -07:00
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
Type=simple
|
2026-05-12 16:58:32 +02:00
|
|
|
ExecStart=%h/.venv/iai-mcp/bin/python -m iai_mcp.daemon
|
2026-05-19 10:32:06 +02:00
|
|
|
Restart=always
|
2026-05-06 01:04:47 -07:00
|
|
|
RestartSec=30
|
|
|
|
|
|
|
|
|
|
Environment="IAI_MCP_STORE=%h/.iai-mcp"
|
2026-05-12 16:45:15 +02:00
|
|
|
Environment="QDRANT_URL=http://192.168.0.22:6333"
|
|
|
|
|
Environment="QDRANT_API_KEY=1CerixWX$3zdlj"
|
|
|
|
|
Environment="IAI_MCP_EMBED_MODEL=bge-m3"
|
2026-05-06 01:04:47 -07:00
|
|
|
Environment="LANG=en_US.UTF-8"
|
|
|
|
|
|
|
|
|
|
StandardOutput=journal
|
|
|
|
|
StandardError=journal
|
|
|
|
|
SyslogIdentifier=iai-mcp-daemon
|
|
|
|
|
|
|
|
|
|
# Graceful shutdown: systemd default TimeoutStopSec is 90s; we tighten to 60s
|
|
|
|
|
# so stop never kills us mid-Claude (subprocess timeout is 120s but the
|
|
|
|
|
# daemon aborts the pending call cleanly on SIGTERM).
|
|
|
|
|
TimeoutStopSec=60
|
|
|
|
|
KillSignal=SIGTERM
|
|
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=default.target
|