mc_services_managers / servives managers registries & functions

mc_states.modules.mc_services_managers.get_service_enabled_state(pm=None, enable_toggle=None)

Return if a service should be enabled at boot or not depending on the service function.

if service func is ‘running’ -> enabled if service func is ‘dead’ -> disaabled

mc_states.modules.mc_services_managers.get_service_function(pm=None, enable_toggle=None, has_system_services_manager=None, activate_function='service.running', deactivate_function='service.dead')

Return the appropriate service function for the activated process manager For the API conveniance, we reflect back any service.function. If pm is system, or manually forced, we want to return the appropriate service function (one of: activate_function/deactivate_function). We take care to check not to return any function when we are in a docker hence we do not have any system level function, nor the access to the service module

the processes manager (one of none|system|circus|supervisor|service.{running,dead}) system means to return a function between activate or deactivate
choose if we are in system mode either to return the ‘activate’ or ‘deactivate’ function, by default we return the activate function
salt module function to activate a service (api compatible with service.*)
salt module function to deactivate a service (api compatible with service.*)
overrides the makina-states detection of the presence of a system services manager

Global services registry