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


PHP unix::DEBIAN_INSTALL_PACKAGE方法代码示例

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


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

示例1: install

function install()
{
    $unix = new unix();
    $DISTRICODE = $unix->LINUX_CODE_NAME();
    $arch = $unix->LINUX_ARCHITECTURE();
    $VERS = $unix->LINUX_VERS();
    $dpkg = $unix->find_program("dpkg");
    echo "DISTRICODE:{$DISTRICODE} \n";
    if (!python_verify_modules("MySQLdb")) {
        $unix->DEBIAN_INSTALL_PACKAGE("python-mysqldb");
    }
    if (!python_verify_modules("ldap")) {
        echo "Installing python-ldap\n";
        if ($DISTRICODE == "DEBIAN") {
            if ($arch == 64) {
                if ($VERS[0] == 6) {
                    if (is_file("/usr/share/artica-postfix/bin/install/postfix/python-6-ldap-amd64.deb")) {
                        shell_exec("{$dpkg} -i --force-all /usr/share/artica-postfix/bin/install/postfix/python-6-ldap-amd64.deb");
                    }
                }
                if ($VERS[0] == 7) {
                    if (is_file("/usr/share/artica-postfix/bin/install/postfix/python-7-ldap-amd64.deb")) {
                        shell_exec("{$dpkg} -i --force-all /usr/share/artica-postfix/bin/install/postfix/python-7-ldap-amd64.deb");
                    }
                }
            }
        }
    }
    if (!python_verify_modules("ldap")) {
        $unix->DEBIAN_INSTALL_PACKAGE("python-ldap");
    }
    if (!python_verify_modules("ldap")) {
        echo "Warning, ldap/python-ldap not installed...\n";
        return;
    }
    if (!python_verify_modules("MySQLdb")) {
        echo "Warning, MySQLdb/python-mysqldb not installed...\n";
        return;
    }
    echo "MySQLdb / python-mysqldb OK\n";
    echo "LDAP / python-ldap OK\n";
    $tmpdir = $unix->TEMP_DIR() . "/iredmail";
    $tar = $unix->find_program("tar");
    $rm = $unix->find_program("rm");
    if (!is_file("/usr/share/artica-postfix/bin/install/postfix/iredapd.tar.gz")) {
        return;
    }
    @mkdir($tmpdir, 0755, true);
    shell_exec("{$tar} xf /usr/share/artica-postfix/bin/install/postfix/iredapd.tar.gz -C /");
    if (!is_file("/opt/iRedAPD/iredapd.py")) {
        return;
    }
    @chmod("/opt/iRedAPD/iredapd.py", 0755);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:54,代码来源:exec.iredmail.install.php

示例2: installapt

function installapt()
{
    @unlink($GLOBALS["LOGFILE"]);
    $unix = new unix();
    $mount = $unix->find_program("mount");
    $umount = $unix->find_program("umount");
    $tar = $unix->find_program("tar");
    $rm = $unix->find_program("rm");
    echo "Please wait...\n";
    build_progress("{update_debian_repository}", 5);
    $aptget = $unix->find_program("apt-get");
    build_progress("{updating_repository}", 15);
    echo "Please wait, running apt-get install\n";
    $cmd = "DEBIAN_FRONTEND=noninteractive {$aptget} --force-yes update";
    system($cmd);
    build_progress("{INSTALL_VMWARE_TOOLS}", 50);
    $unix->DEBIAN_INSTALL_PACKAGE("open-vm-tools");
    if (!is_file("/usr/bin/vmware-toolbox-cmd")) {
        build_progress("{INSTALL_VMWARE_TOOLS} {failed_to_install}", 110);
        return;
    }
    build_progress("{INSTALL_VMWARE_TOOLS} {success}", 90);
    build_progress("{removing_caches}", 95);
    $unix->REMOVE_INTERFACE_CACHE();
    build_progress("{success}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:exec.vmwaretools.php

示例3: Checks

function Checks()
{
    $GLOBALS["NORELOAD"] = true;
    $unix = new unix();
    if (!is_file("/usr/lib/x86_64-linux-gnu/autofs/lookup_ldap.so")) {
        build_progress_rs("{install} autofs-ldap", 15);
        $unix->DEBIAN_INSTALL_PACKAGE("autofs-ldap");
    }
    if (!is_file("/usr/lib/x86_64-linux-gnu/autofs/lookup_ldap.so")) {
        build_progress_rs("{install} autofs-ldap {failed}", 110);
        return;
    }
    if (!$unix->is_socket("/var/run/slapd/slapd.sock")) {
        build_progress_rs("{restarting_service} OpenLDAP", 15);
        system("/etc/init.d/slapd restart");
    } else {
        if ($GLOBALS["PROGRESS"]) {
            build_progress_rs("{restarting_service} OpenLDAP", 15);
            system("/etc/init.d/slapd restart");
        }
    }
    $curlftpfs = $unix->find_program("curlftpfs");
    $fusermount = $unix->find_program("fusermount");
    if (is_file($curlftpfs)) {
        if (!is_file("/sbin/mount.curl")) {
            build_progress_rs("/sbin/mount.curl", 15);
            $curlftpfsZ[] = "#! /bin/sh";
            $curlftpfsZ[] = "{$curlftpfs} \$1 \$2 -o \$5,disable_eprt";
            $curlftpfsZ[] = "";
            @file_put_contents("/sbin/mount.curl", @implode("\n", $curlftpfsZ));
            @chmod("/sbin/mount.curl", 0755);
        }
        if (!is_file("/sbin/umount.curl")) {
            build_progress_rs("/sbin/umount.curl", 15);
            $curlftpfsZ = array();
            $curlftpfsZ[] = "#! /bin/sh";
            $curlftpfsZ[] = "{$fusermount} -u \$1";
            $curlftpfsZ[] = "";
            @file_put_contents("/sbin/umount.curl", @implode("\n", $curlftpfsZ));
            @chmod("/sbin/umount.curl", 0755);
        }
    }
    $ldap = new clladp();
    $data = "<?xml version=\"1.0\" ?>\n         <autofs_ldap_sasl_conf\n                 usetls=\"no\"\n                 tlsrequired=\"no\"\n                 authrequired=\"yes\"\n                 authtype=\"PLAIN\"\n                 user=\"{$ldap->ldap_admin}\"\n                 secret=\"{$ldap->ldap_password}\"\n         />";
    @file_put_contents("/etc/autofs_ldap_auth.conf", $data);
    if (is_file("/etc/autofs_ldap_auth.conf")) {
        @chmod("/etc/autofs_ldap_auth.conf", 0600);
        @chown("/etc/autofs_ldap_auth.conf", "root");
        @chgrp("/etc/autofs_ldap_auth.conf", "root");
    }
    build_progress_rs("{checking_configuration}", 15);
    $auto = new autofs();
    build_progress_rs("{checking_configuration}", 20);
    autofs_default();
    build_progress_rs("{checking_configuration}", 25);
    Autocount();
    build_progress_rs("{checking_configuration}", 30);
    davfs();
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:59,代码来源:exec.AutoFS.php

示例4: install

function install()
{
    $unix = new unix();
    $unix->DEBIAN_INSTALL_PACKAGE("console-setup");
    if (is_file("/bin/setupcon")) {
        echo "* * * * * SUCCESS * * * * *\n";
        return;
    }
    echo "* * * * * FAILED * * * * *\n";
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:10,代码来源:exec.menu.keyboard.php

示例5: install

function install()
{
    if (extension_loaded('snmp')) {
        return;
    }
    $unix = new unix();
    $FileTime = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".time";
    if ($unix->file_time_min($FileTime) < 15) {
        return;
    }
    @unlink($FileTime);
    @file_put_contents($FileTime, time());
    $unix->DEBIAN_INSTALL_PACKAGE("php5-snmp");
    system("/etc/init.d/artica-webconsole restart");
    system("/etc/init.d/artica-status restart");
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:16,代码来源:exec.snmp.install.php

示例6: pgsql

function pgsql()
{
    if (extension_loaded('pgsql')) {
        return;
    }
    $unix = new unix();
    $FileTime = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".time";
    if ($unix->file_time_min($FileTime) < 15) {
        return;
    }
    @unlink($FileTime);
    @file_put_contents($FileTime, time());
    squid_admin_mysql(1, "Installing missing package php5-pgsql", null, __FILE__, __LINE__);
    $unix->DEBIAN_INSTALL_PACKAGE("php5-pgsql");
    system("/usr/share/artica-postfix/exec.php.ini.php");
    system("/etc/init.d/artica-webconsole restart");
    system("/etc/init.d/artica-status restart");
}
开发者ID:articatech,项目名称:artica,代码行数:18,代码来源:exec.snmp.install.php

示例7: install

function install()
{
    $unix = new unix();
    $timefile = "/etc/artica-postfix/pids/" . __FILE__ . ".time";
    if ($unix->file_time_min($timefile) < 240) {
        return;
    }
    @unlink($timefile);
    @file_put_contents($timefile, time());
    $bin = $unix->find_program("fail2ban-server");
    if (!is_file($bin)) {
        $unix->DEBIAN_INSTALL_PACKAGE("fail2ban");
    }
    $bin = $unix->find_program("fail2ban-server");
    $fail2ban = new fail2ban();
    if (is_file($bin)) {
        $fail2ban->buildinit();
        build();
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:20,代码来源:exec.fail2ban.php

示例8: arp_scanner

function arp_scanner($net, $insert = false)
{
    if (!is_file("/usr/bin/arp-scan")) {
        if (!isset($GLOBALS["DEBIAN_INSTALL_PACKAGE_ARP_SCAN"])) {
            $unix = new unix();
            $unix->DEBIAN_INSTALL_PACKAGE("arp-scan");
            $GLOBALS["DEBIAN_INSTALL_PACKAGE_ARP_SCAN"] = true;
        }
        if (!is_file("/usr/bin/arp-scan")) {
            return array();
        }
    }
    exec("/usr/bin/arp-scan --quiet --retry=1 {$net} 2>&1", $results);
    $MAIN = array();
    while (list($num, $line) = each($results)) {
        $line = trim($line);
        if ($line == null) {
            continue;
        }
        if (!preg_match("#^([0-9]+).([0-9]+).([0-9]+).([0-9]+)\\s+(.+?)\\s+(.+)#", $line, $re)) {
            continue;
        }
        $ipaddr = "{$re[1]}.{$re[2]}.{$re[3]}.{$re[4]}";
        $mac = $re[5];
        $vendor = $re[6];
        echo "Found {$ipaddr} -> {$mac} ( {$vendor} )\n";
        $date = date("Y-m-d H:i:s");
        $GLOBALS[$mac]["IP"] = $ipaddr;
        $GLOBALS[$mac]["MACHINE_TYPE"] = $vendor;
        $MAIN[] = "('{$ipaddr}','{$mac}','{$vendor}','{$date}')";
    }
    if (!$insert) {
        return $MAIN;
    }
    if (count($MAIN) == 0) {
        return;
    }
    while (list($mac, $array) = each($MAIN)) {
        $cmp = new computers();
        $uid = $cmp->ComputerIDFromMAC($mac);
        $array["HOSTNAME"] = gethostbyname($array["IP"]);
        $ipaddr = $array["IP"];
        if (preg_match("#^[0-9\\.]+\$#", $array["HOSTNAME"])) {
            $array["HOSTNAME"] = null;
        }
        if ($uid != null) {
            if ($GLOBALS["VERBOSE"]) {
                echo "{$mac} = {$uid}\n";
            }
            $cmp = new computers($uid);
            $ldap_ipaddr = $cmp->ComputerIP;
            $ComputerRealName = $cmp->ComputerRealName;
            if ($GLOBALS["VERBOSE"]) {
                echo "{$mac} = {$uid}\nLDAP:{$ldap_ipaddr}<>NMAP:{$ipaddr}\nLDAP CMP:{$ComputerRealName}<>NMAP:{$array["HOSTNAME"]}";
            }
            if ($array["HOSTNAME"] != null) {
                $EXPECTED_UID = strtoupper($array["HOSTNAME"]) . "\$";
                if ($EXPECTED_UID != $uid) {
                    $RAISON[] = "UID: {$uid} is different from {$EXPECTED_UID}";
                    nmap_logs("EDIT UID: {$mac}:[{$array["HOSTNAME"]}] ({$ipaddr})", @implode("\n", $array) . "\n" . @implode("\n", $RAISON), $uid);
                    $cmp->update_uid($EXPECTED_UID);
                }
            }
            if ($ldap_ipaddr != $ipaddr) {
                writelogs("Change {$ldap_ipaddr} -> to {$ipaddr} for  {$cmp->uid}", __FUNCTION__, __FILE__, __LINE__);
                $RAISON[] = "LDAP IP ADDR: {$ldap_ipaddr} is different from {$ipaddr}";
                $RAISON[] = "DN: {$cmp->dn}";
                $RAISON[] = "UID: {$cmp->uid}";
                $RAISON[] = "MAC: {$cmp->ComputerMacAddress}";
                if (!$cmp->update_ipaddr($ipaddr)) {
                    $RAISON[] = "ERROR:{$cmp->ldap_last_error}";
                }
                nmap_logs("EDIT IP: {$mac}:[{$array["HOSTNAME"]}] ({$ipaddr})", @implode("\n", $array) . "\n" . @implode("\n", $RAISON), $uid);
            }
            continue;
        }
        if ($array["HOSTNAME"] != null) {
            $uid = "{$array["HOSTNAME"]}\$";
        } else {
            continue;
        }
        nmap_logs("ADD NEW: {$mac}:[{$array["HOSTNAME"]}] ({$ipaddr})", @implode("\n", $array) . "\n" . @implode("\n", $RAISON), "{$uid}");
        $cmp = new computers();
        $cmp->ComputerIP = $ipaddr;
        $cmp->ComputerMacAddress = $mac;
        $cmp->uid = "{$uid}";
        $cmp->ComputerRunning = 1;
        $cmp->ComputerMachineType = $array["MACHINE_TYPE"];
        $cmp->Add();
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:91,代码来源:exec.nmapscan.php

示例9: php_snmp

function php_snmp()
{
    $unix = new unix();
    php_snmp_progress("{checking_php_snmp}", 20);
    $unix->DEBIAN_INSTALL_PACKAGE("php5-snmp");
    $nohup = $unix->find_program("nohup");
    if (is_file("/usr/lib/php5/20090626/snmp.so")) {
        php_snmp_progress("{checking_php_snmp} {success}", 100);
        sleep(5);
        system("{$nohup} /etc/init.d/artica-webconsole restart >/dev/null 2>&1 &");
        system("{$nohup} /etc/init.d/artica-status restart >/dev/null 2>&1 &");
    }
    if (is_file("/usr/lib/php5/20100525/snmp.so")) {
        php_snmp_progress("{checking_php_snmp} {success}", 100);
        sleep(5);
        system("{$nohup} /etc/init.d/artica-webconsole restart >/dev/null 2>&1 &");
        system("{$nohup} /etc/init.d/artica-status restart >/dev/null 2>&1 &");
    }
    php_snmp_progress("{checking_php_snmp} {failed}", 110);
    //php5-snmp
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:21,代码来源:exec.lighttpd.php

示例10: install

function install()
{
    $unix = new unix();
    $rm = $unix->find_program("rm");
    $cgrulesengd = $unix->find_program("cgrulesengd");
    echo "cgrulesengd = {$cgrulesengd}\n";
    if (is_file($cgrulesengd)) {
        build_progress_install("{success}", 100);
        return;
    }
    $GLOBALS["OUTPUT"] = true;
    build_progress_install("{installing} {please_wait}", 15);
    $unix = new unix();
    $cgrulesengd = null;
    $unix->DEBIAN_INSTALL_PACKAGE("cgroup-bin", true);
    if (is_file("/usr/sbin/cgrulesengd")) {
        $cgrulesengd = "/usr/sbin/cgrulesengd";
    }
    if ($cgrulesengd == null) {
        $cgrulesengd = $unix->find_program("cgrulesengd", true);
    }
    if (is_file($cgrulesengd)) {
        build_progress_install("{learning_artica}", 80);
        system("/usr/share/artica-postfix/bin/process1 --force --verbose --" . time());
        build_progress_install("{removing_caches}", 90);
        $unix->REMOVE_INTERFACE_CACHE();
        start();
        build_progress_install("{success}", 100);
        return;
    }
    build_progress_install("{failed_to_install}", 110);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:32,代码来源:exec.cgroups.php

示例11: start


//.........这里部分代码省略.........
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Use Remote statistics.: {$InfluxUseRemote}\n";
    }
    if (!$users->POSTFIX_INSTALLED) {
        $EnableIntelCeleron = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableIntelCeleron"));
        if ($EnableIntelCeleron == 1) {
            $EnableInfluxDB = 0;
        }
    }
    if (is_file("/etc/artica-postfix/STATS_APPLIANCE")) {
        $EnableInfluxDB = 1;
        $SquidPerformance = 0;
        $EnableIntelCeleron = 0;
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Use Statistics DB.....: {$EnableInfluxDB}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Use Intel Celeron mode: {$EnableIntelCeleron}\n";
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Use Performance.......: {$SquidPerformance}\n";
    }
    if ($EnableInfluxDB == 0) {
        build_progress_restart("{starting} {failed} {disabled}", 110);
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} service disabled (see EnableInflux)\n";
        }
        return;
    }
    if (!function_exists("pg_connect")) {
        build_progress_restart("{starting} installing php5-pgsql", 35);
        $unix->DEBIAN_INSTALL_PACKAGE("php5-pgsql");
        system("/usr/share/artica-postfix/exec.php.ini.php");
        if (!function_exists("pg_connect")) {
            build_progress_restart("{starting} installing php5-pgsql {failed}", 110);
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} pg_connect no such function\n";
            }
            return;
        }
        system("/etc/init.d/artica-webconsole restart");
    }
    build_progress_restart("{starting}", 40);
    if (!$unix->UnixUserExists("ArticaStats")) {
        $unix->CreateUnixUser("ArticaStats", "ArticaStats");
    }
    @mkdir("/var/run/ArticaStats", 0755, true);
    @mkdir("/home/ArticaStatsDB", 0700, true);
    @mkdir("/var/log/ArticaStatsDB", 0755, true);
    @chown("/home/ArticaStatsDB", "ArticaStats");
    @chgrp("/home/ArticaStatsDB", "ArticaStats");
    @chown("/var/run/ArticaStats", "ArticaStats");
    @chgrp("/var/run/ArticaStats", "ArticaStats");
    @chown("/var/log/ArticaStatsDB", "ArticaStats");
    @chgrp("/var/log/ArticaStatsDB", "ArticaStats");
    if (is_file("/var/log/ArticaStatsDB/ArticaStatsDB.log")) {
        @unlink("/var/log/ArticaStatsDB/ArticaStatsDB.log");
        @touch("/var/log/ArticaStatsDB/ArticaStatsDB.log");
    }
    @chown("/var/log/ArticaStatsDB/ArticaStatsDB.log", "ArticaStats");
    @chgrp("/var/log/ArticaStatsDB/ArticaStatsDB.log", "ArticaStats");
    if (is_file("/var/run/ArticaStats/.s.PGSQL.8086")) {
        @unlink("/var/run/ArticaStats/.s.PGSQL.8086");
    }
开发者ID:articatech,项目名称:artica,代码行数:67,代码来源:exec.postgres.php

示例12: varlog

function varlog()
{
    $unix = new unix();
    $rsync = $unix->find_program("rsync");
    $rm = $unix->find_program("rm");
    if (!is_file($rsync)) {
        $unix->DEBIAN_INSTALL_PACKAGE("rsync");
    }
    //$GLOBALS["ArticaMaxLogsSize"]=$ArticaMaxLogsSize;
    //$GLOBALS["logs_cleaning"]=$sock->GET_NOTIFS("logs_cleaning");
    //$GLOBALS["MaxTempLogFilesDay"]=$sock->GET_INFO("MaxTempLogFilesDay");
    //if($GLOBALS["MaxTempLogFilesDay"]==null){$GLOBALS["MaxTempLogFilesDay"]=5;}
    if (!is_numeric($GLOBALS["ArticaMaxLogsSize"])) {
        init();
    }
    $sock = new sockets();
    $LogsRotateDefaultSizeRotation = $sock->GET_INFO("LogsRotateDefaultSizeRotation");
    if (!is_numeric($LogsRotateDefaultSizeRotation)) {
        $LogsRotateDefaultSizeRotation = 100;
    }
    $LogsDirectoryStorage = $sock->GET_INFO("LogsDirectoryStorage");
    if (trim($LogsDirectoryStorage) == null) {
        $LogsDirectoryStorage = "/home/logs-backup";
    }
    $echo = $unix->find_program("echo");
    $LogRotatePath = $sock->GET_INFO("LogRotatePath");
    if ($LogRotatePath == null) {
        $LogRotatePath = "/home/logrotate";
    }
    $SQUIDEnable = $sock->GET_INFO("SQUIDEnable");
    if (!is_numeric($SQUIDEnable)) {
        $SQUIDEnable = 1;
    }
    $REMOVE_PHP_SCRIPTS[] = "/usr/share/artica-postfix/miniadm.logon.php";
    $REMOVE_PHP_SCRIPTS[] = "/usr/share/artica-postfix/miniadm.index.php";
    $REMOVE_PHP_SCRIPTS[] = "/usr/share/artica-postfix/miniadm.logoff.php";
    while (list($index, $filepath) = each($REMOVE_PHP_SCRIPTS)) {
        if (is_file($filepath)) {
            @unlink($filepath);
        }
    }
    $RESTART_SQUID = false;
    $syslog[] = "/var/log/syslog";
    $syslog[] = "/var/log/messages";
    $syslog[] = "/var/log/daemon.log";
    $syslog[] = "/var/log/auth.log";
    $syslog[] = "/var/log/kern.log";
    $syslog[] = "/var/log/user.log";
    $other[] = "/var/log/php.log";
    $other[] = "/var/log/artica-postfix/framework.log";
    $other[] = "/usr/share/artica-postfix/ressources/logs/php.log";
    $other[] = "/var/log/artica-postfix/logrotate.debug";
    $other[] = "/var/log/ArticaProc.log";
    $other[] = "/var/log/clamav/clamav.log";
    $other[] = "/var/log/clamav/clamd.log";
    $other[] = "/var/log/clamav/freshclam.log";
    $other[] = "/var/log/lighttpd/access.log";
    $other[] = "/var/log/lighttpd/apache-access.log";
    $other[] = "/var/log/apt/history.log";
    $other[] = "/var/log/apt/term.log";
    $other[] = "/var/log/redis/redis-server.log";
    $other[] = "/var/log/clamav-unofficial-sigs.log";
    $other[] = "/var/log/influxdb/influxdb.startup";
    $other[] = "/var/log/influxdb/influxd.log";
    $other[] = "/var/log/influxdb/influxd.service.log";
    if (is_dir("/usr/share/artica-postfix/ressources/ressources")) {
        shell_exec("{$rm} -rf /usr/share/artica-postfix/ressources/ressources");
    }
    if (is_file("/var/log/artica-postfix/squid-logger-start.log")) {
        shell_exec("{$echo} \"\">/var/log/artica-postfix/squid-logger-start.log");
    }
    if (is_file("/var/log/artica-postfix/exec.syslog-engine.php.log")) {
        shell_exec("{$echo} \"\">/var/log/artica-postfix/exec.syslog-engine.php.log");
    }
    if (is_file("/var/log/squid/squidtail.log")) {
        $size = @filesize("/var/log/squid/squidtail.log") / 1024 / 1000;
        if ($size > $LogsRotateDefaultSizeRotation) {
            if (@copy("/var/log/squid/squidtail.log", "{$LogRotatePath}/squidtail.log." . time())) {
                shell_exec("{$echo} \"\">/var/log/squid/squidtail.log");
                $RESTART_SYSLOG = true;
                $RESTART_SQUID = true;
            }
        }
    }
    if (is_file("/var/log/squid/logfile_daemon.debug")) {
        $size = @filesize("/var/log/squid/logfile_daemon.debug") / 1024 / 1000;
        if ($size > $LogsRotateDefaultSizeRotation) {
            shell_exec("{$echo} \"\">/var/log/squid/logfile_daemon.debug");
            $RESTART_SYSLOG = true;
        }
    }
    if (is_file("/var/log/squid/ext_time_quota_acl.log")) {
        $size = @filesize("/var/log/squid/ext_time_quota_acl.log") / 1024 / 1000;
        if ($size > $LogsRotateDefaultSizeRotation) {
            shell_exec("{$echo} \"\">/var/log/squid/ext_time_quota_acl.log");
        }
    }
    $RESTART_SYSLOG = false;
    $checks = array();
    while (list($index, $filepath) = each($syslog)) {
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.clean.logs.php

示例13: start_prepare


//.........这里部分代码省略.........
    }
    shell_exec("{$php} /usr/share/artica-postfix/exec.squid.php --watchdog-config >/dev/null 2>&1");
    exec("{$php} /usr/share/artica-postfix/exec.squid.transparent.php", $GLOBALS["LOGS"]);
    if (!is_file("/etc/init.d/tproxy start")) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " Building transparent method\n";
        }
        exec("{$php} /usr/share/artica-postfix/exec.squid.transparent.php", $GLOBALS["LOGS"]);
    } else {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " Starting transparent method\n";
        }
        exec("/etc/init.d/tproxy start", $GLOBALS["LOGS"]);
    }
    $directories_squid[] = "/var/squid";
    $directories_squid[] = "/var/squid/cache";
    $directories_squid[] = "/usr/share/squid3/icons";
    $directories_squid[] = "/var/log/squid";
    $directories_squid[] = "/etc/squid3";
    $directories_squid[] = "/var/lib/squidguard";
    $directories_squid[] = "/var/run/squid";
    $directories_squid[] = "/lib/squid3";
    $directories_chmod[] = "/var/logs";
    $directories_chmod[] = "/var/log";
    $directories_chmod[] = "/var";
    $directories_chmod_owned[] = "/home/squid";
    $filesOblig[] = "/etc/squid3/url_rewrite_program.deny.db";
    $filesOblig[] = "/var/run/squid/squid.pid";
    while (list($num, $directory) = each($directories_squid)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Preparing.....: " . date("H:i:s") . " {$directory}\n";
        }
        if (!is_dir($directory)) {
            @mkdir($directory, 0755, true);
        }
        @chmod($directory, 0755);
        $unix->chmod_func(0755, "{$directory}/*");
        $unix->chown_func("squid", "squid", "{$directory}/*");
    }
    while (list($num, $directory) = each($directories_chmod)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Preparing.....: " . date("H:i:s") . " {$directory}\n";
        }
        if (!is_dir($directory)) {
            @mkdir($directory, 0755, true);
        }
        @chmod($directory, 0755);
    }
    while (list($num, $directory) = each($directories_chmod)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Preparing.....: " . date("H:i:s") . " {$directory}\n";
        }
        if (!is_dir($directory)) {
            @mkdir($directory, 0755, true);
        }
        $unix->chmod_func(0755, "{$directory}");
        $unix->chown_func("squid", "squid", "{$directory}");
    }
    while (list($num, $filepath) = each($filesOblig)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Preparing.....: " . date("H:i:s") . " {$filepath}\n";
        }
        if (!is_file($filepath)) {
            @touch("{$filepath}");
        }
        @chmod($filepath, 0755);
        @chown($filepath, "squid");
        @chgrp($filepath, "squid");
    }
    $articafiles[] = "exec.logfile_daemon.php";
    $articafiles[] = "external_acl_squid_ldap.php";
    $articafiles[] = "external_acl_dynamic.php";
    $articafiles[] = "external_acl_quota.php";
    $articafiles[] = "external_acl_basic_auth.php";
    $articafiles[] = "external_acl_squid.php";
    while (list($num, $filename) = each($articafiles)) {
        $filepath = "/usr/share/artica-postfix/{$filename}";
        if ($GLOBALS["OUTPUT"]) {
            echo "Preparing.....: " . date("H:i:s") . " {$filepath}\n";
        }
        @chmod($filepath, 0755);
        @chown($filepath, "squid");
        @chgrp($filepath, "squid");
    }
    $squid_locate_pinger = $unix->squid_locate_pinger();
    $setcap = $unix->find_program("setcap");
    if (is_file($squid_locate_pinger)) {
        @chmod($squid_locate_pinger, 0755);
        @chown($squid_locate_pinger, "squid");
        @chgrp($squid_locate_pinger, "squid");
        if (is_file("{$setcap}")) {
            shell_exec("{$setcap} cap_net_raw=pe {$squid_locate_pinger}");
        } else {
            if ($GLOBALS["OUTPUT"]) {
                echo "Preparing.....: " . date("H:i:s") . " WARNING! setcap, no such binary!!\n";
            }
            $unix->DEBIAN_INSTALL_PACKAGE("libcap2-bin");
        }
    }
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.squid.watchdog.php

示例14: start

function start($nopid = false)
{
    $unix = new unix();
    $sock = new sockets();
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    if (!$nopid) {
        $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["SERVICE_NAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
            }
            return;
        }
    }
    $pid = redis_pid();
    if ($unix->process_exists($pid)) {
        $time = $unix->PROCCESS_TIME_MIN($pid);
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Already running since {$time}Mn...\n";
        }
        return;
    }
    $Enablentopng = $sock->GET_INFO("Enablentopng");
    if (!is_numeric($Enablentopng)) {
        $Enablentopng = 0;
    }
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    if ($SquidPerformance > 2) {
        $Enablentopng = 0;
    }
    if ($Enablentopng == 0) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Disabled ( see Enablentopng )...\n";
        }
        return;
    }
    $masterbin = $unix->find_program("redis-server");
    $masterbin = $unix->find_program("redis-server");
    if (!is_file($masterbin)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} installing redis-server\n";
        }
        $unix->DEBIAN_INSTALL_PACKAGE("redis-server");
        $masterbin = $unix->find_program("redis-server");
    }
    if (!is_file($masterbin)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Not installed...\n";
        }
        return;
    }
    CheckFilesAndSecurity();
    $version = redis_version();
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Starting service v{$version}\n";
    }
    $cmd = "{$masterbin} /etc/redis/redis.conf";
    shell_exec($cmd);
    $c = 1;
    for ($i = 0; $i < 10; $i++) {
        sleep(1);
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Starting service waiting {$c}/10\n";
        }
        $pid = redis_pid();
        if ($unix->process_exists($pid)) {
            if ($GLOBALS["OUTPUT"]) {
                echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Success PID {$pid}\n";
            }
            break;
        }
        $c++;
    }
    $pid = redis_pid();
    if (!$unix->process_exists($pid)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} Failed\n";
        }
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} {$cmd}\n";
        }
    }
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:85,代码来源:exec.redis-server.php

示例15: install

function install()
{
    $unix = new unix();
    build_progress("{installing_firewall_service}", 10);
    $src_package = "/usr/share/artica-postfix/bin/install/firehol-debian7-64.tar.gz";
    if (!is_file($src_package)) {
        build_progress("{source_package_not_found}", 110);
        return;
    }
    $tar = $unix->find_program("tar");
    $php = $unix->LOCATE_PHP5_BIN();
    build_progress("{uncompress}", 20);
    shell_exec("{$tar} xvf /usr/share/artica-postfix/bin/install/firehol-debian7-64.tar.gz -C /");
    build_progress("{installing_service}", 30);
    $ipset = $unix->find_program("ipset");
    if (!is_file($ipset)) {
        build_progress("{installing_service} - IPSET -", 35);
        $unix->DEBIAN_INSTALL_PACKAGE("ipset");
    }
    build_init(true);
    build_progress("{refresh_settings}", 60);
    system("/usr/share/artica-postfix/bin/process1 --force --verbose --" . time());
    build_progress("{restart_status_service}", 70);
    system("/etc/init.d/artica-status restart --force");
    build_progress("{done}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:exec.firehol.php


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