示例#1
0
function multi_start_all()
{
    $q = new mysqlserver();
    $GLOBALS["MULTI"] = true;
    $q->mysql_multi();
    $sql = "SELECT ID  FROM `mysqlmulti` WHERE enabled=1 ORDER BY ID DESC";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, 'artica_backup');
    if (!$q->ok) {
        return;
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        multi_start($ligne["ID"]);
    }
}
示例#2
0
function status_zarafa_server($ID)
{
    if (!$GLOBALS["CLASS_USERS"]->ZARAFA_INSTALLED) {
        if ($GLOBALS["VERBOSE"]) {
            echo __FUNCTION__ . " not installed\n";
        }
        return null;
    }
    $enabled = 1;
    $pid_path = "/var/run/zarafa-server-{$ID}.pid";
    $master_pid = trim(@file_get_contents($pid_path));
    if (!is_numeric($enabled)) {
        $enabled = 1;
    }
    $l[] = "[APP_ZARAFA_SERVER:{$ID}]";
    $l[] = "service_name=APP_ZARAFA_SERVER";
    $l[] = "master_version=" . $GLOBALS["CLASS_UNIX"]->ZARAFA_VERSION();
    $l[] = "service_cmd=zarafa";
    $l[] = "service_disabled={$enabled}";
    $l[] = "pid_path={$pid_path}";
    $l[] = "remove_cmd=--zarafa-remove";
    $l[] = "watchdog_features=1";
    $l[] = "family=mailbox";
    if ($enabled == 0) {
        return implode("\n", $l);
        return;
    }
    if (!$GLOBALS["CLASS_UNIX"]->process_exists($master_pid)) {
        multi_start($ID);
        $l[] = "running=0\ninstalled=1";
        $l[] = "";
    } else {
        $l[] = "running=1";
    }
    $meme = $GLOBALS["CLASS_UNIX"]->GetMemoriesOf($master_pid);
    $l[] = $meme;
    $l[] = "";
    $l[] = "[APP_ZARAFA:{$ID}]";
    $l[] = "service_name=APP_ZARAFA";
    $l[] = "master_version=" . $GLOBALS["CLASS_UNIX"]->ZARAFA_VERSION();
    $l[] = "family=mailbox";
    $l[] = "service_cmd=zarafa";
    $l[] = "service_disabled={$enabled}";
    $l[] = "pid_path={$pid_path}";
    $l[] = "remove_cmd=--zarafa-remove";
    $l[] = "watchdog_features=1";
    if (!$GLOBALS["CLASS_UNIX"]->process_exists($master_pid)) {
        WATCHDOG("APP_ZARAFA", "zarafa");
        $l[] = "running=0\ninstalled=1";
        $l[] = "";
        return implode("\n", $l);
        return;
    }
    $l[] = "running=1";
    $l[] = $meme;
    $l[] = "";
    return implode("\n", $l);
}