Webhooks
Run commands on service lifecycle events.Events
| Stage | When | Outcomes |
|---|---|---|
on_start | Service spawn | success, error |
on_stop | Service exit | success, error |
on_restart | Auto-restart after crash | success, error |
- Manual stops =
success - Crashes =
error - Only auto-restarts trigger
on_restart
Configuration
Execution
- Run via
sh -c - Fire-and-forget (no retries)
- Timeout kills with SIGKILL
- Failures logged but don’t affect service
Behavior
| Scenario | Hooks |
|---|---|
| Start success | on_start.success |
| Start failure | on_start.error |
| Manual stop | on_stop.success |
| Crash | on_stop.error → restart |
| Restart after crash | on_stop.error, on_start.success, on_restart.success |
Tips
- Keep commands short
- Use env vars for secrets
- Make endpoints idempotent