Skip to content

Document and ship a systemd unit file example for running memayu serve as a persistent service #49

Closed

Description

@savioruz

Summary

Currently there's no guidance for keeping memayu serve running persistently and restarting it automatically (e.g. after a Raspberry Pi reboot). This doesn't need automation built into the binary itself — a documented, ready-to-copy systemd unit file is sufficient and is the standard expectation for this kind of self-hosted tool.

Fix

Add a contrib/systemd/memayu.service example file to the repository, and reference it from the README's self-hosted deployment section:

[Unit]
Description=Memayu memory server
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/memayu serve
Restart=on-failure
RestartSec=5
EnvironmentFile=/etc/memayu/.env
User=memayu

[Install]
WantedBy=multi-user.target

(Adjust paths/user to match actual installed conventions — this is illustrative, verify against how the binary is actually expected to be installed via Homebrew/npm/manual build.)

Document in the README: where to place this file, how to enable it (systemctl enable --now memayu), and how it interacts with .env (via EnvironmentFile, once Issue 1 in this batch is fixed and confirmed working) or config.toml.

Acceptance criteria

  • contrib/systemd/memayu.service exists in the repo with working example content.
  • README has a short "Running as a service" section linking to it, including enable/start/status/logs commands (systemctl status memayu, journalctl -u memayu -f).
  • Manually verified on a real device (e.g. the Raspberry Pi used for this testing round) that the unit file works as documented: survives a reboot, restarts on crash.

Activity

  1. added this to the v0.1.0 milestone on Aug 15, 2026
  2. added
    documentationImprovements or additions to documentation
    priority-mediumMedium priority — important but not blocking
    self-hostedRelates to self-hosted / local-first usage
    on Aug 15, 2026
  3. savioruz commented on Aug 25, 2026

    @savioruz
    OwnerAuthor

    Implemented by PR #65 (docs-only, fixes #49) — ships a systemd unit (contrib/systemd/memayu.service: unprivileged memayu user, Restart=on-failure, persisted DB at /var/lib/memayu/memayu.db) and a Docker Compose example (restart: unless-stopped, readiness /api/health healthcheck, memayu-data volume) plus a new TROUBLESHOOTING.md (run memayu doctor first) and README pointers. No code/schema changes. Reviewed by g3333kbot: APPROVED (1 warning: compose healthcheck waits for "ready" so container shows unhealthy until first-run setup — should be called out in TROUBLESHOOTING.md too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationpriority-mediumMedium priority — important but not blockingself-hostedRelates to self-hosted / local-first usage

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions