Example #1
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 #2
0
function updatecleanup()
{
    setPrepareKloxo();
    // Fixes #303 and #304
    installThirdparty();
    install_gd();
    install_bogofilter();
    setInitialPhpMyAdmin();
    setInitialAdminAccount();
    setInitialKloxoPhp();
    installWebmail();
    installAwstats();
    setRemoveOldDirs();
    setInitialBinary();
    log_cleanup("Remove lighttpd errorlog");
    log_cleanup("- Remove process");
    remove_lighttpd_error_log();
    log_cleanup("Fix the secure logfile");
    log_cleanup("- Fix process");
    call_with_flag("fix_secure_log");
    log_cleanup("Clean hosts.deny");
    log_cleanup("- Clean process");
    call_with_flag("remove_host_deny");
    log_cleanup("Turn off mouse daemon");
    log_cleanup("- Turn off process");
    system("chkconfig gpm off");
    if (lxfile_exists("phpinfo.php")) {
        log_cleanup("Remove phpinfo.php");
        log_cleanup("- Remove process");
        lxfile_rm("phpinfo.php");
    }
    setInitialBind();
    log_cleanup("Killing gettraffic system process");
    log_cleanup("- Killing process");
    lxshell_return("pkill", "-f", "gettraffic");
    setCheckPackages();
    copy_script();
    uploadStatsLxCenter();
    install_xcache();
    log_cleanup("Install Kloxo service");
    log_cleanup("- Install process");
    lxfile_unix_chmod("/etc/init.d/kloxo", "0755");
    system("chkconfig kloxo on");
    setJailshellSystem();
    log_cleanup("Set /home permission to 0755");
    log_cleanup("- Set process");
    lxfile_unix_chmod("/home", "0755");
    setExecuteCentos5Script();
    fix_rhn_sources_file();
    setInitialApacheConfig();
    setInitialPureftpConfig();
    setInstallMailserver();
    log_cleanup("Enable xinetd service");
    log_cleanup("- Enable process");
    call_with_flag("enable_xinetd");
    fix_suexec();
    if (!lxfile_exists("/usr/bin/php-cgi")) {
        log_cleanup("Initialize php-cgi binary");
        log_cleanup("- Initialize process");
        lxfile_cp("/usr/bin/php", "/usr/bin/php-cgi");
    }
    setSomePermissions();
    setInitialLighttpdConfig();
    setInitialNobodyScript();
    setSomeScript();
    log_cleanup("Install /etc/init.d/djbdns service file");
    log_cleanup("- Install process");
    lxfile_cp("../file/djbdns.init", "/etc/init.d/djbdns");
    removeOtherDrivers();
    log_cleanup("Remove cache dir");
    log_cleanup("- Remove process");
    lxfile_rm_rec("__path_program_root/cache");
    log_cleanup("Restart syslog service");
    log_cleanup("- Restart process");
    createRestartFile('syslog');
    log_cleanup("Initialize awstats dirdata");
    log_cleanup("- Initialize process");
    lxfile_mkdir("/home/kloxo/httpd/awstats/dirdata");
    setInitialLogrotate();
    installRoundCube();
    // DT17022014
    // Disable horde link as horde is not in use
    // Project issue #1084
    //	installHorde();
    installChooser();
    log_cleanup("Remove old lxlabs ssh key");
    log_cleanup("- Remove process");
    remove_ssh_self_host_key();
    setInitialServer();
    setDefaultPages();
    installInstallApp();
    setFreshClam();
    changeMailSoftlimit();
    updatePEARchannel();
}