Crate pispas_service

Crate pispas_service 

Source
Expand description

§pispas_service — Windows service wrapper

Thin wrapper that registers with the Windows Service Control Manager (SCM) and, once SCM has started it, spawns and supervises the real runtime binary (pispas_modules).

Why this extra layer? Because:

  • SCM expects a binary that implements the service dispatch loop (ServiceMain). pispas_modules is a plain tokio::main — easier to develop and test stand-alone without SCM ceremony.
  • This wrapper handles STOP / PAUSE / CONTINUE events coming from the SCM and translates them into graceful shutdown / restart signals for pispas_modules.
  • Keeps SCM-specific Windows-API code isolated from the business logic.
  Windows SCM  --start/stop-->  pispas-service.exe  (THIS BIN)
                                         |
                                         | spawn / signal
                                         v
                                  pispas-modules.exe

The installer (pispas-installer.exe, via pispas-elevator.exe for UAC) calls sc create "PispasService" binPath=… pointing at this binary.

Implementation details live in the service module next to this file.

Authors: Jorge.A Duran & Mario González · pispas Technologies SL · 2023.

Modules§

service 🔒

Functions§

init_logging 🔒
main 🔒