1 #ifndef SERVICE_CONSTANTS_H
2 #define SERVICE_CONSTANTS_H
5 enum class ServiceState {
6 STOPPED, // service is not running.
7 STARTING, // service is starting, and will start (or fail to start) in time.
8 STARTED, // service is running,
9 STOPPING // service script is stopping and will stop.
13 enum class ServiceType {
14 DUMMY, // Dummy service, used to detect cyclice dependencies
15 PROCESS, // Service runs as a process, and can be stopped by
16 // sending the process a signal (usually SIGTERM)
17 BGPROCESS, // Service runs as a process which "daemonizes" to run in the
19 SCRIPTED, // Service requires an external command to start,
20 // and a second command to stop
21 INTERNAL // Internal service, runs no external process
25 enum class ServiceEvent {
26 STARTED, // Service was started (reached STARTED state)
27 STOPPED, // Service was stopped (reached STOPPED state)
28 FAILEDSTART, // Service failed to start (possibly due to dependency failing)
29 STARTCANCELLED, // Service was set to be started but a stop was requested
30 STOPCANCELLED // Service was set to be stopped but a start was requested
34 enum class ShutdownType {
35 CONTINUE, // Continue normal boot sequence (used after single-user shell)
36 HALT, // Halt system without powering down
37 POWEROFF, // Power off system
38 REBOOT // Reboot system