Пример #1
0
function updatecleanup()
{
    global $gbl, $sgbl, $login, $ghtml;
    print "Checking program service\n";
    os_create_program_service();
    print "Checking permissions\n";
    os_fix_lxlabs_permission();
    print "Restart myself\n";
    os_restart_program();
    print "Start Some cleanups:\n";
    updateApplicableToSlaveToo();
}
Пример #2
0
function create_main()
{
    global $argc, $argv;
    global $gbl, $sgbl, $login, $ghtml;
    $opt = parse_opt($argv);
    lxfile_mkdir("{$sgbl->__path_program_etc}/conf");
    lxfile_mkdir("{$sgbl->__path_program_root}/pid");
    lxfile_mkdir("{$sgbl->__path_program_root}/log");
    lxfile_mkdir("{$sgbl->__path_httpd_root}");
    os_fix_lxlabs_permission();
    os_create_program_service();
    os_create_kloxo_service_once();
    if (isset($opt['admin-password'])) {
        $admin_pass = $opt['admin-password'];
    } else {
        $admin_pass = 'admin';
    }
    if ($opt['install-type'] == 'master') {
        create_mysql_db('master', $opt, $admin_pass);
        create_database();
        create_general();
        init_main($admin_pass);
        lxshell_return("__path_php_path", "../bin/collectquota.php");
        print "This will take a long time... Please wait...\n";
        system("/usr/local/lxlabs/ext/php/php ../bin/common/tmpupdatecleanup.php --type=master");
    } else {
        if ($opt['install-type'] == 'slave') {
            init_slave($admin_pass);
            print "This will take a long time... Please wait...\n";
            system("/usr/local/lxlabs/ext/php/php ../bin/common/tmpupdatecleanup.php --type=slave");
        } else {
            if ($opt['install-type'] == 'supernode') {
                $sgbl->__path_sql_file = $sgbl->__path_sql_file_supernode;
                $sgbl->__var_dbf = $sgbl->__path_supernode_db;
                $sgbl->__path_admin_pass = $sgbl->__path_super_pass;
                $sgbl->__var_admin_user = $sgbl->__var_super_user;
                create_mysql_db('super', $opt, $admin_pass);
                init_supernode($admin_pass);
                print "\n";
            } else {
                print "Unknown Install type\n";
                flush();
            }
        }
    }
    os_create_default_slave_driver_db();
    os_fix_some_permissions();
}
Пример #3
0
function cleanupUpdate()
{
    global $gbl, $sgbl, $login, $ghtml;
    $prognameNice = $sgbl->__var_program_name_nice;
    print "Checking {$prognameNice} service\n";
    os_create_program_service();
    print "Checking {$prognameNice} permissions\n";
    os_fix_lxlabs_permission();
    print "Restart {$prognameNice}\n";
    os_restart_program();
    print "Start {$prognameNice} cleanups\n";
    cleanupProcess();
}
Пример #4
0
<?php

// LxCenter:
// Migrate LxAdmin to Kloxo
//
@mkdir("../pid");
@mkdir("../log");
include_once "htmllib/lib/include.php";
os_fix_lxlabs_permission();
cp_rec_if_not_exists("/etc/httpd/conf/lxadmin/", "/etc/httpd/conf/kloxo");
cp_if_not_exists("/etc/httpd/conf/lxadmin/lxadmin.conf", "/etc/httpd/conf/kloxo/kloxo.conf");
cp_if_not_exists("/var/bogofilter/lxadmin.wordlist.db", "/var/bogofilter/kloxo.wordlist.db");
change_lxadmin_to_kloxo_directory("/etc/httpd/conf/kloxo/");
change_lxadmin_to_kloxo("/etc/httpd/conf/httpd.conf");
change_lxadmin_to_kloxo("/etc/php.ini");
cp_rec_if_not_exists("/usr/lib/lxadminphp/", "/usr/lib/kloxophp");
cp_rec_if_not_exists("/var/tinydns/root/lxadmin", "/var/tinydns/root/kloxo");
lxfile_mkdir("/var/log/kloxo");
change_lxadmin_to_kloxo("/etc/syslog.conf");
change_lxadmin_to_kloxo("/etc/init.d/courier-imap");
change_lxadmin_to_kloxo("/usr/bin/lxredirecter.sh");
change_lxadmin_to_kloxo("/etc/xinetd.d/pureftp");
change_lxadmin_to_kloxo_directory("/etc/awstats/");
lxfile_mkdir("/home/kloxo");
mv_rec_if_not_exists("/home/lxadmin/httpd/", "/home/kloxo/httpd/");
cp_rec_if_not_exists("/home/lxadmin/lxguard/", "/home/kloxo/lxguard/");
mv_rec_if_not_exists("/home/lxadmin/client", "/home/kloxo/client");
mv_rec_if_not_exists("/home/lxadmin/domain", "/home/kloxo/domain");
cp_rec_if_not_exists("/home/lxadmin/selfbackup", "/home/kloxo/selfbackup");
lxfile_rm_rec("/usr/local/lxlabs/kloxo/httpdocs/img/custom/");
lxfile_rm_rec("/usr/local/lxlabs/kloxo/httpdocs/img/logo/");
Пример #5
0
function setPrepareKloxo()
{
    log_cleanup("Prepare for Kloxo");
    log_cleanup("- OS Create Kloxo init.d service file and copy core php.ini (lxphp)");
    os_create_program_service();
    log_cleanup("- OS Fix programroot path permissions");
    os_fix_lxlabs_permission();
    log_cleanup("- OS Restart Kloxo service");
    os_restart_program();
}