SystemServiceControl.hpp

1. Overview

The SystemServiceControl.hpp header defines cross-init-system service identification and containment APIs used when a protected service definition is attacked.

The file integrates the following components, APIs, or runtime concepts:

  • systemd
  • OpenRC
  • dinit
  • SysV init

2. InitSystem Enumeration

Supported runtime types are None, Systemd, OpenRC, Dinit, and SysVInit.


3. ServiceTarget

ServiceTarget combines detected init system, logical service name, and the affected service-definition path.


4. Action Result

ServiceActionResult returns both success/failure and a diagnostic message suitable for logging or UI feedback.


5. Public Functions

  • detectInitSystem()
  • toString(InitSystem)
  • identifySystemService(path)
  • blockSystemService(path)
  • unblockSystemService(path)

6. Runtime and Security Considerations

  • Path-to-service resolution: containment starts from the attacked definition path rather than trusting arbitrary service names from an event.
  • Cross-distribution behavior: one API supports several init ecosystems.