This commit is contained in:
2026-08-17 11:19:05 -07:00
parent ca0f89a671
commit cf87fdba1a
6 changed files with 199 additions and 5 deletions
+13
View File
@@ -13,6 +13,19 @@ EnvironmentFile=/etc/bookstack-mcp/env
WorkingDirectory=/opt/bookstack-mcp
ExecStart=/opt/bookstack-mcp/venv/bin/python -m bookstack_mcp
# ProtectSystem=strict makes everything read-only, but the MCP library writes
# to a data directory under $HOME (OAuth client registrations, caches). The
# service user's home is /opt/bookstack-mcp, which is part of the read-only
# tree -- so point HOME and the XDG dirs at directories systemd creates and
# grants write access to. Without this the service dies with
# "OSError: [Errno 30] Read-only file system: '/opt/bookstack-mcp/.local'".
StateDirectory=bookstack-mcp
CacheDirectory=bookstack-mcp
Environment=HOME=/var/lib/bookstack-mcp
Environment=XDG_DATA_HOME=/var/lib/bookstack-mcp
Environment=XDG_CONFIG_HOME=/var/lib/bookstack-mcp
Environment=XDG_CACHE_HOME=/var/cache/bookstack-mcp
Restart=on-failure
RestartSec=5s
TimeoutStopSec=20s