Skip to main content

Module boot_autostart

Module boot_autostart 

Source
Expand description

Per-OS boot autostart for the runpm daemon (Phase 4 of #222 — #427).

Each OS implementation exposes the same trio:

  • install(daemon_binary) — write the unit/plist/task and arm the init system. Returns the unit path that was written.
  • uninstall() — disarm the init system and remove the unit.
  • render_unit(daemon_binary) — render the unit text without touching the filesystem. Used by fixture tests and by install.

Backends:

  • Linux: systemd user unit at $XDG_CONFIG_HOME/systemd/user/runpm-daemon.service.
  • macOS: launchd user agent at ~/Library/LaunchAgents/com.zackees.runpm-daemon.plist.
  • Windows: Task Scheduler ONLOGON task named runpm-daemon via the schtasks CLI.

Tests never call install — they assert against render_unit output to avoid mutating the runner’s init system.

Modules§

linux
Linux backend: systemd user unit at $XDG_CONFIG_HOME/systemd/user/runpm-daemon.service.

Structs§

UnitPath
Typed wrapper around the path where the unit/plist/task was written. Wrapped so callers can’t accidentally pass it as a generic PathBuf and lose the “this is the autostart artifact” intent.

Enums§

BootAutostartError
Anything that can go wrong installing/uninstalling boot autostart.

Functions§

install
Install boot autostart for the running-process daemon. Returns the path where the unit/plist/task was written.
render_unit
Render the unit/plist/task text for the current OS without touching the filesystem. Test seam used by tests/runpm_boot_autostart_fixtures.rs.
uninstall
Uninstall boot autostart for the running-process daemon.