|
PebbleOS
|
Global switch of the system operating mode. More...
Modules | |
| Runlevel enable masks | |
| Definitions used to implement runlevels. | |
Enumerations | |
| enum | RunLevel { RunLevel_COUNT } |
| System runlevel. More... | |
Functions | |
| void | services_set_runlevel (RunLevel runlevel) |
| Switch the system to a runlevel. | |
Global switch of the system operating mode.
Roughly analogous to SysVinit runlevels. In each runlevel, a service controlled by the runlevel system is either enabled (operating normally) or disabled (suppressed, non-operational). The exact meaning of the enabled state is up to the service.
The enabled state acts like a circuit breaker for a light switch: with the breaker off, the light is off whatever the switch position; with it on, the switch decides. Many services let the switch be flipped while disabled, the change taking effect once enabled.
A controllable service provides a single service_set_enabled(bool) function that:
Starting disabled avoids an uninitialized, enabled, disabled sequence when booting into a runlevel where the service is off, and exercises the disabled to enabled path on every boot.
There is deliberately no services_get_runlevel(): code must not change behaviour based on the runlevel without being listed and controlled by services_set_runlevel(). Make the service controllable by the runlevel system instead.
Runlevels are defined in runlevel.def; see Runlevel enable masks for enable masks.
| enum RunLevel |
| void services_set_runlevel | ( | RunLevel | runlevel | ) |
Switch the system to a runlevel.
Enables or disables every runlevel-controlled service according to its enable mask.
| runlevel | Runlevel to switch to. |