当前位置: 首页>>代码示例>>PHP>>正文


PHP sockets::DisableUfdbCat方法代码示例

本文整理汇总了PHP中sockets::DisableUfdbCat方法的典型用法代码示例。如果您正苦于以下问题:PHP sockets::DisableUfdbCat方法的具体用法?PHP sockets::DisableUfdbCat怎么用?PHP sockets::DisableUfdbCat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sockets的用法示例。


在下文中一共展示了sockets::DisableUfdbCat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: start

function start($aspid = false, $verifdbs = false)
{
    $unix = new unix();
    $sock = new sockets();
    $Masterbin = "/opt/ufdbcat/bin/ufdbcatdd";
    if (!is_file($Masterbin)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, ufdbguardd not installed\n";
        }
        return;
    }
    if (!$aspid) {
        $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
        $pid = $unix->get_pid_from_file($pidfile);
        if ($unix->process_exists($pid, basename(__FILE__))) {
            $time = $unix->PROCCESS_TIME_MIN($pid);
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
            }
            return;
        }
        @file_put_contents($pidfile, getmypid());
    }
    $pid = PID_NUM();
    if ($unix->process_exists($pid)) {
        $timepid = $unix->PROCCESS_TIME_MIN($pid);
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Service already started {$pid} since {$timepid}Mn...\n";
        }
        if ($GLOBALS["MONIT"]) {
            @file_put_contents($GLOBALS["PID_PATH"], $pid);
        }
        return;
    }
    $DisableUfdbCat = $sock->DisableUfdbCat();
    if ($DisableUfdbCat == 1) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} service disabled (see DisableUfdbCat)\n";
        }
        stop();
        return;
    }
    $php5 = $unix->LOCATE_PHP5_BIN();
    $sysctl = $unix->find_program("sysctl");
    $echo = $unix->find_program("echo");
    $nohup = $unix->find_program("nohup");
    $kill = $unix->find_program("kill");
    $cp = $unix->find_program("cp");
    @mkdir("/etc/ufdbcat", 0755, true);
    @mkdir("/var/log/ufdbcat", 0755, true);
    @mkdir(dirname($GLOBALS["PID_PATH"]), 0755, true);
    @chmod($GLOBALS["PID_PATH"], 0755);
    @chmod($Masterbin, 0755);
    build_progress("{starting_service}", 10);
    CheckDirectories($verifdbs);
    if (is_file("/var/log/ufdbcat/ufdbguardd.log")) {
        @unlink("/var/log/ufdbcat/ufdbguardd.log");
    }
    if (is_file("/var/run/ufdbcat-03977")) {
        @unlink("/var/run/ufdbcat-03977");
    }
    if ($unix->is_socket("/var/run/ufdbcat-03977")) {
        @unlink("/var/run/ufdbcat-03977");
    }
    $AsCategoriesAppliance = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/AsCategoriesAppliance"));
    $Threads = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/UfdbCatThreads"));
    if ($Threads == 0) {
        $Threads = 4;
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} pid path: {$GLOBALS["PID_PATH"]}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Threads:{$Threads}\n";
    }
    if (is_file("/opt/ufdbcat/bin/ufdbhttpd")) {
        @unlink("/opt/ufdbcat/bin/ufdbhttpd");
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} ** Categories Appliance Mode ***\n";
    }
    $isRemoteSockets = isRemoteSockets();
    if ($isRemoteSockets) {
        if (!is_file("{$Masterbin}.sock")) {
            @copy($Masterbin, "{$Masterbin}.sock");
        }
        $ufdbguardd = $unix->find_program("ufdbguardd");
        if (!is_file($ufdbguardd)) {
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Fatal ufdbguardd no such binary!!!\n";
            }
            return false;
        }
        @unlink($Masterbin);
        @copy($ufdbguardd, $Masterbin);
    }
    if (!$isRemoteSockets) {
        if (is_file("{$Masterbin}.sock")) {
            @copy("{$Masterbin}.sock", $Masterbin);
            @unlink("{$Masterbin}.sock");
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.ufdbcat.php


注:本文中的sockets::DisableUfdbCat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。