!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/   drwxr-xr-x
Free 292.97 GB of 429.69 GB (68.18%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     daemon_base.py (2.84 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# coding=utf-8
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENCE.TXT
#

# pylint: disable=no-absolute-import

import logging
import os
import signal

from clcommon.utils import get_process_pid

from clwpos.daemon_config import load_config

logger = logging.getLogger(__name__)


class WposDaemonBase:
    """
    AccelerateWP daemon base class. Signals, signal handlers, setup daemon logger, pid file operations
    """
    _PID_FILENAME = "/var/run/clwpos_monitoring.pid"

    def __init__(self):
        self._reload_config_need = False
        self._is_terminate = False
        self._config = load_config()

        logger.info("Cloudlinux AccelerateWP daemon uses monitoring interval: %d seconds",
                    self._config.monitoring_interval)
        if not self._config.enable_reload_rate_limit:
            logger.info("NOTE: Cloudlinux AccelerateWP daemon check reload interval is OFF by config")
        logger.info("NOTE: Cloudlinux AccelerateWP daemon logging level=%s",
                    self._config.logging_level)

    def _setup_signals(self):
        """
        Setup daemon signal handlers
        """
        # Setup SIGHUP signal handler for config reload
        signal.signal(signal.SIGHUP, self._sighup_handler)
        # Setup Ctrl-C signal handler. Used for console debug
        signal.signal(signal.SIGINT, self._sigint_handler)
        # Setup SIGTERM signal. Called when daemon stops
        signal.signal(signal.SIGTERM, self._sigterm_handler)

    def run(self):
        """
        Main work daemon function (implement in child class)
        """
        raise NotImplementedError()

    def stop(self, *args, **kwargs):
        """
        Stops a working daemon process (implement in child class)
        """
        raise NotImplementedError()

    def reload(self):
        """
        Reload working daemon process by sending SIGHUP signal to it
        """
        try:
            pid = get_process_pid(self._PID_FILENAME)
            if pid:
                os.kill(pid, signal.SIGHUP)
        except:
            pass

    def _sighup_handler(self, signum, frame):
        """
        SIGHUP signal handler
        """
        # Load new user configuration from config file
        self._reload_config_need = True
        logger.info("SIGHUP: Cloudlinux AccelerateWP daemon sheduled for reload")

    def _sigint_handler(self, signum, frame):
        """
        SIGINT (Ctrl-C) signal handler. For console debug
        """
        logger.info("Ctrl-C received, exit")
        # Terminate main cycle
        self._is_terminate = True

    def _sigterm_handler(self, signum, frame):
        """
        SIGTERM signal handler. Called when daemon stopping
        """
        # Terminate main cycle
        self._is_terminate = True

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.082 ]--