Skip to content

feat: add service startup hooks#777

Draft
asturur wants to merge 1 commit into
mainfrom
track-boot-launch-boot
Draft

feat: add service startup hooks#777
asturur wants to merge 1 commit into
mainfrom
track-boot-launch-boot

Conversation

@asturur
Copy link
Copy Markdown
Member

@asturur asturur commented May 3, 2026

Summary

Adds configurable startup ZapScript hooks:

  • launchers.on_service_start, which runs after the service finishes platform post-start
  • launchers.on_boot_start, which runs only once per detected OS boot

The boot-scoped hook persists the last observed boot ID in the Zaparoo data directory. Linux platforms use /proc/sys/kernel/random/boot_id; other platforms fall back to an uptime-derived boot time.

Impact

This gives users a native way to run ZapScript on service startup, including launch-at-boot workflows, without external startup scripts calling the HTTP /run/ endpoint.

Validation

  • go test ./pkg/config ./pkg/service

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac887f89-c109-44f4-8453-a471de534c9b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch track-boot-launch-boot

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@asturur
Copy link
Copy Markdown
Member Author

asturur commented May 3, 2026

i made this for discussion is a feature i was suggested

@wizzomafizzo
Copy link
Copy Markdown
Member

I think it's a cool idea. My only nitpick would bet put it in the service config group instead of launchers

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants