Skip to content

feat: add cross-platform service management (Windows SCM / systemd / … - #26

Open
MarksonHon wants to merge 1 commit into
olicesx:mainfrom
MarksonHon:main
Open

feat: add cross-platform service management (Windows SCM / systemd / …#26
MarksonHon wants to merge 1 commit into
olicesx:mainfrom
MarksonHon:main

Conversation

@MarksonHon

Copy link
Copy Markdown
Contributor

…OpenRC / Procd / BSD rc.d)

Introduce built-in service wrapper supporting all major init systems:

  • Windows: register/unregister with SCM, proper service event handling
  • Linux (systemd): auto-generate .service unit, systemctl enable/start
  • Linux (OpenRC): auto-generate init script, rc-update add/start
  • OpenWrt (Procd): auto-generate procd init script
  • FreeBSD (BSD rc.d): auto-generate rc.d script
  • Unknown: graceful error with manual setup instructions

Key changes:

  • Remove feature gates; windows-service is now a regular dependency
  • Refactor src/service.rs into a directory module (mod.rs + windows.rs + unix.rs)
  • Add InitSystem auto-detection with documented priority order
  • Add init-detection-based install/uninstall for all supported systems
  • Implement Unix signal handling (SIGTERM/SIGINT/SIGQUIT) via tokio for service run
  • Keep CLI identical across platforms: 'kixdns service install|uninstall|run'
  • Update READMEs with bilingual collapsible service script templates

…OpenRC / Procd / BSD rc.d)

Introduce built-in service wrapper supporting all major init systems:

- Windows: register/unregister with SCM, proper service event handling
- Linux (systemd): auto-generate .service unit, systemctl enable/start
- Linux (OpenRC): auto-generate init script, rc-update add/start
- OpenWrt (Procd): auto-generate procd init script
- FreeBSD (BSD rc.d): auto-generate rc.d script
- Unknown: graceful error with manual setup instructions

Key changes:
- Remove feature gates; windows-service is now a regular dependency
- Refactor src/service.rs into a directory module (mod.rs + windows.rs + unix.rs)
- Add InitSystem auto-detection with documented priority order
- Add init-detection-based install/uninstall for all supported systems
- Implement Unix signal handling (SIGTERM/SIGINT/SIGQUIT) via tokio for service run
- Keep CLI identical across platforms: 'kixdns service install|uninstall|run'
- Update READMEs with bilingual collapsible service script templates
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.

1 participant