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
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 uninstallto register and manage scheduled worker execution.Background
The current scheduling implementation is tightly coupled to macOS launchd:
src/commands/install.tsgenerates a plist file and registers it withlaunchctlsrc/commands/uninstall.tsunregisters fromlaunchctland removes the plistsrc/utils/plist.tshandles plist template renderingsrc/utils/paths.tsdefines launchd-specific pathsRequirements
systemctl --user) to register a periodic service and timer unit.serviceand.timerunit files under~/.config/systemd/user/execution.interval_minutesconfiguration as launchdsabori-flow installshould create and enable a systemd user timersabori-flow uninstallshould stop, disable, and remove the systemd user unitssabori-flow reinstallshould work correctly on LinuxNotes