Example #1
0
function clearsession_main()
{
    global $gbl, $sgbl, $login, $ghtml;
    initProgramlib('admin');
    $login->__session_timeout = true;
    $ulist = $login->getList('utmp');
    if (!empty($ulist)) {
        foreach ($ulist as $u) {
            if ($u->timeout < time()) {
                $u->setUpdateSubaction('');
                $u->logouttime = time();
                $u->logoutreason = 'Session Expired';
                $u->write();
            }
        }
    }
    $slist = $login->getList("ssessionlist");
    if (!empty($slist)) {
        foreach ($slist as $s) {
            if ($s->timeout < time()) {
                $s->dbaction = 'delete';
                $s->write();
            }
        }
    }
}
Example #2
0
function scavenge_main()
{
    global $gbl, $sgbl, $login, $ghtml;
    log_scavenge("Fix log dir");
    passthru("{$sgbl->__path_php_path} ../bin/common/fixlogdir.php");
    log_scavenge("### Starting Scavenge");
    initProgramlib('admin');
    uploadStatsLxCenter();
    if (lxfile_exists("../etc/conf/scavenge_time.conf")) {
        log_scavenge("Found scavenge_time.conf");
    }
    log_scavenge("Collect Traffic");
    passthru("{$sgbl->__path_php_path} ../bin/gettraffic.php");
    log_scavenge("Collect Quota");
    passthru("{$sgbl->__path_php_path} ../bin/collectquota.php");
    log_scavenge("Schedule backups");
    passthru("{$sgbl->__path_php_path} ../bin/common/schedulebackup.php");
    log_scavenge("Clear Sessions");
    passthru("{$sgbl->__path_php_path} ../bin/common/clearsession.php");
    log_scavenge("Self backup");
    passthru("{$sgbl->__path_php_path} ../bin/common/mebackup.php");
    log_scavenge("Check Cluster Disk Quota");
    checkClusterDiskQuota();
    $driverapp = $gbl->getSyncClass(null, 'localhost', 'web');
    if ($driverapp === 'lighttpd') {
        log_scavenge("Restarting lighttpd");
        system("service lighttpd restart");
    }
    log_scavenge("InstallApp update");
    passthru("{$sgbl->__path_php_path} ../bin/installapp-update.phps");
    log_scavenge("Watchdog checks");
    $rs = get_all_pserver();
    foreach ($rs as $r) {
        watchdog::addDefaultWatchdog($r);
    }
    log_scavenge("Collect LxGuard info");
    lxguard::collect_lxguard();
    log_scavenge("Fix MySQL root password");
    fix_all_mysql_root_password();
    log_scavenge("Auto update Kloxo");
    auto_update();
    log_scavenge("### End Scavenge");
    // Wait at least 60 seconds before ending the scavenge
    sleep(60);
}
Example #3
0
function scavenge_main()
{
    global $gbl, $sgbl, $login, $ghtml;
    log_shell("Scavenge: Start");
    initProgramlib('admin');
    log_shell("Scavenge: Collect Traffic");
    passthru("{$sgbl->__path_php_path} ../bin/gettraffic.php");
    log_shell("Scavenge: Collect Quota");
    passthru("{$sgbl->__path_php_path} ../bin/collectquota.php");
    log_shell("Scavenge: Schedule backups");
    passthru("{$sgbl->__path_php_path} ../bin/common/schedulebackup.php");
    log_shell("Scavenge: Clear Sessions");
    passthru("{$sgbl->__path_php_path} ../bin/common/clearsession.php");
    log_shell("Scavenge: Self backup");
    passthru("{$sgbl->__path_php_path} ../bin/common/mebackup.php");
    log_shell("Scavenge: Check Cluster Disk Quota");
    checkClusterDiskQuota();
    $driverapp = $gbl->getSyncClass(null, 'localhost', 'web');
    if ($driverapp === 'lighttpd') {
        log_shell("Scavenge: Restarting lighttpd");
        system("service lighttpd restart");
    }
    log_shell("Scavenge: Fix log dir");
    passthru("{$sgbl->__path_php_path} ../bin/common/fixlogdir.php");
    log_shell("Scavenge: InstallApp update");
    passthru("{$sgbl->__path_php_path} ../bin/installapp-update.phps");
    log_shell("Scavenge: Watchdog checks");
    $rs = get_all_pserver();
    foreach ($rs as $r) {
        watchdog::addDefaultWatchdog($r);
    }
    log_shell("Scavenge: Collect LxGuard info");
    lxguard::collect_lxguard();
    log_shell("Scavenge: Fix MySQL root password");
    fix_all_mysql_root_password();
    log_shell("Scavenge: Auto update Kloxo");
    auto_update();
}
Example #4
0
function initProgram($ctype = NULL)
{
    global $gbl, $sgbl, $login, $ghtml;
    initProgramlib($ctype);
}