Skip to content

Run as a background service

Install and manage Revka as an OS service across launchd, systemd, OpenRC, and Windows.

revka service runs revka daemon as a persistent, OS-managed background service so it starts automatically on login or boot and is restarted on failure. One command set — install, start, stop, restart, status, logs, uninstall — drives the right native mechanism for your platform: a launchd agent on macOS, a systemd user unit or OpenRC init script on Linux, and a Windows Task Scheduler task on Windows.

Reach for this page once you want Revka to survive reboots and crashes without a terminal open. For the command-level reference (flags, subcommands, pairing) see revka gateway, daemon & service; for the daemon itself and its component supervisor see the same page.

revka service auto-detects the platform and, on Linux, the init system:

PlatformMechanismArtifact
macOSlaunchd agent~/Library/LaunchAgents/com.revka.daemon.plist
Linux (systemd)systemd user unit~/.config/systemd/user/revka.service
Linux (OpenRC / Alpine)OpenRC init script/etc/init.d/revka
WindowsScheduled Tasktask named Revka Daemon

Linux detection is deny-by-default: it picks systemd if /run/systemd/system exists, otherwise OpenRC if /run/openrc exists and an OpenRC binary (/sbin/openrc-run or rc-service) is present, and errors out if it can find neither. Force a choice with --service-init:

Terminal window
revka service --service-init systemd install
revka service --service-init openrc install
FlagValuesDefaultMeaning
--service-initauto, systemd, openrcautoForce a specific Linux init system. Pass it before the subcommand.

The same subcommands work on every OS:

Terminal window
revka service install # generate and register the unit / plist / task
revka service start # start the service (rotates logs first)
revka service stop # stop the running service
revka service restart # stop then start
revka service status # report whether the daemon is running
revka service logs # tail the daemon logs (default: last 50 lines)
revka service logs -n 100 --follow
revka service uninstall # remove the unit / plist / task
SubcommandPurpose
installGenerate the platform artifact, register it, and (systemd) enable it for login start.
startStart the service. Rotates daemon logs first if they exceed 20 MB.
stopStop the running service.
restartStop then start.
statusReport service state. Also checks the 45-second-fresh daemon state file as a fallback.
logsTail daemon logs. -n / --lines <N> sets the line count (default 50); -f / --follow streams new output like tail -f.
uninstallRemove the platform artifact.
  1. Install the service. The platform and init system are auto-detected.

    Terminal window
    revka service install
  2. Start it.

    Terminal window
    revka service start
  3. Confirm it is healthy. Check the service state and the public health endpoint.

    Terminal window
    revka service status
    curl http://127.0.0.1:42617/health

revka service install writes a launchd agent plist to ~/Library/LaunchAgents/com.revka.daemon.plist and loads it with launchctl load -w followed by launchctl start com.revka.daemon. The agent runs revka daemon with RunAtLoad and KeepAlive both true, so it starts at login and is relaunched if it exits.

The generated plist looks like this:

<?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>com.revka.daemon</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/revka</string>
<string>daemon</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>SoftResourceLimits</key>
<dict>
<key>NumberOfFiles</key>
<integer>4096</integer>
</dict>
<key>HardResourceLimits</key>
<dict>
<key>NumberOfFiles</key>
<integer>8192</integer>
</dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:...</string>
</dict>
<key>StandardOutPath</key>
<string>/Users/you/.revka/logs/daemon.stdout.log</string>
<key>StandardErrorPath</key>
<string>/Users/you/.revka/logs/daemon.stderr.log</string>
</dict>
</plist>
KeyValueWhy
RunAtLoad / KeepAlivetrueStart at login and relaunch on exit.
SoftResourceLimitsNumberOfFiles4096File-descriptor soft cap. launchd defaults to 256, which an agent spawning MCP sidecars exhausts.
HardResourceLimitsNumberOfFiles8192Hard ceiling. Operators can ulimit -n up to this at runtime without reinstalling.
EnvironmentVariablesPATHcuratedAn explicit PATH so the daemon can spawn subprocess tools.
Terminal window
revka service install
revka service start
revka service logs --follow

If Revka was installed via Homebrew, revka service install detects it automatically and adapts the plist:

  • Logs go to <brew_prefix>/var/revka/logs/ instead of ~/.revka/logs/.
  • The plist adds a REVKA_CONFIG_DIR environment key and a WorkingDirectory pointing at the Homebrew var/revka directory, so your config and workspace survive brew upgrade.

brew services start revka uses the same plist:

Terminal window
brew services start revka

See macOS update & uninstall for the full Homebrew lifecycle.

Daemon logs (daemon.stdout.log and daemon.stderr.log) are rotated before each revka service start:

  • Rotation triggers only when a log file exceeds 20 MB.
  • Up to 5 rotated copies are kept, named daemon.stdout.log.1 through daemon.stdout.log.5 (and likewise for stderr).
  • The oldest copy is deleted, the rest shift up by one, and the current file becomes .1.

Logs live in the Homebrew var/revka/logs/ directory when Revka is installed via Homebrew, otherwise in <config_dir>/logs/.

ConstantValueMeaning
Rotation threshold20 MBA log file smaller than this is left untouched.
Retained files5Maximum number of rotated copies kept per stream.
  • Liveness. GET http://127.0.0.1:42617/health returns 200 with pairing status and a component snapshot and needs no auth. revka status --format exit-code exits 0 when healthy and 1 otherwise. Run revka doctor for structured diagnostics.
  • Service won’t start (Windows). revka service status consults the 45-second-fresh daemon state file; if the scheduled task is unavailable, Revka falls back to a direct spawn — re-run revka service install later to restore logon auto-start.
  • systemd service stops after logout. A user unit needs lingering to survive logout: loginctl enable-linger $USER.
  • OpenRC install fails on the user check. A pre-existing revka user with UID ≥ 1000 or a non-nologin shell is rejected; recreate it with the commands printed in the error.
  • Daemon can’t find subprocess tools. The launchd plist, systemd unit, and OpenRC script all inject a curated PATH for exactly this reason. If you installed Revka or its tools to a non-standard location, reinstall the service after the tools are on PATH.
  • Restart loops in the logs. A component keeps failing and the daemon supervisor keeps restarting it with growing backoff — see the component supervisor reference.