Skip to content

feat: Add Linux systemd timer support for scheduled execution #45

Description

@nonz250

Summary

Currently, sabori-flow only supports macOS launchd for scheduled execution. Add support for Linux systemd timers so that Linux users can use sabori-flow install / sabori-flow uninstall to register and manage scheduled worker execution.

Background

The current scheduling implementation is tightly coupled to macOS launchd:

  • src/commands/install.ts generates a plist file and registers it with launchctl
  • src/commands/uninstall.ts unregisters from launchctl and removes the plist
  • src/utils/plist.ts handles plist template rendering
  • src/utils/paths.ts defines launchd-specific paths

Requirements

  • Detect the OS at runtime and use the appropriate scheduler
  • On Linux, use systemd user timers (systemctl --user) to register a periodic service and timer unit
  • Generate .service and .timer unit files under ~/.config/systemd/user/
  • Support the same execution.interval_minutes configuration as launchd
  • sabori-flow install should create and enable a systemd user timer
  • sabori-flow uninstall should stop, disable, and remove the systemd user units
  • sabori-flow reinstall should work correctly on Linux
  • Abstract the scheduler interface so that platform-specific implementations are isolated

Notes

  • See also: the corresponding Windows issue for Task Scheduler support
  • The scheduler abstraction should be designed to accommodate all three platforms (macOS, Windows, Linux)
  • Consider users on non-systemd Linux distros (e.g., cron fallback) as a potential future enhancement

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions