yr d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddl
mZ ddlm
Z
ddlmZ d gZ ej e Z G d
d ej ZdS )um
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Copyright © 2019 Cloud Linux Software Inc.
This software is also available under ImunifyAV commercial license,
see
Services manager plugin.
It enables/disables various service based on an imunify config change.
N)utils)messagesplugins)svcctl)Patchman)PATCHMAN_SERVICE_NAME)is_installedServiceManagerc B e Zd ZdZej j ZdddZd Z d Z
ej e
j j de
j j fd Z ej e
j j e d
e
j j fd Z ej dd
ZddZdS )r
zDService manager plugin: stop/start services based on config changes.N)unitctlc t j | _ | j g| _ d|pt j t i| _ d S Npatchman) asyncioLock_lock!_ensure_consistent_patchman_state _servicesr adaptorr _units)selfr s Q/opt/imunify360/venv/lib/python3.11/site-packages/imav/plugins/service_manager.py__init__zServiceManager.__init__0 s> \^^
@AH6>2G#H#H
c
K d S N )r loops r create_sinkzServiceManager.create_sink7 s r c > K | j D ]} | d {V d S r )r )r services r !_ensure_consistent_services_statez0ServiceManager._ensure_consistent_services_state; s: ~ G'))OOOOOOOO r message_ignoredc K | j 4 d {V | d {V d d d d {V d S # 1 d {V swxY w Y d S r )r r" )r r# s r on_config_updatezServiceManager.on_config_update? s : ; ; ; ; ; ; ; ;88::::::::: ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; >
AA)r! messagec K | j 4 d {V | d {V d d d d {V d S # 1 d {V swxY w Y d S r )r r )r r' s r ensure_patchman_statez$ServiceManager.ensure_patchman_stateF s : ; ; ; ; ; ; ; ;88::::::::: ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;r&