When performing shutdown, un-pin services after issuing stop.
[oweals/dinit.git] / service-constants.h
1 #ifndef SERVICE_CONSTANTS_H
2 #define SERVICE_CONSTANTS_H
3
4 /* Service states */
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.
10 };
11
12 /* Service types */
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 (SIGTERM)
17     SCRIPTED,   // service requires an external command to start,
18                 // and a second command to stop
19     INTERNAL    // internal service, runs no external process
20 };
21
22 /* Service events */
23 enum class ServiceEvent {
24     STARTED,           // Service was started (reached STARTED state)
25     STOPPED,           // Service was stopped (reached STOPPED state)
26     FAILEDSTART,       // Service failed to start (possibly due to dependency failing)
27     STARTCANCELLED,    // Service was set to be started but a stop was requested
28     STOPCANCELLED      // Service was set to be stopped but a start was requested
29 };
30
31 /* Shutdown types */
32 enum class ShutdownType {
33     CONTINUE,          // Continue normal boot sequence (used after single-user shell)
34     HALT,              // Halt system without powering down
35     POWEROFF,          // Power off system
36     REBOOT             // Reboot system
37 };
38
39 #endif