コード例 #1
0
			<td width="22%" valign="top" class="vncellreq">stick-table size</td>
			<td width="78%" class="vtable" colspan="2">
				<input name="persist_stick_tablesize" type="text" <?php 
if (isset($pconfig['persist_stick_tablesize'])) {
    echo "value=\"{$pconfig['persist_stick_tablesize']}\"";
}
?>
 size="20" /> maximum number of entries supports suffixes "k", "m", "g" for 2^10, 2^20 and 2^30 factors.<br/>
				Is the maximum number of entries that can fit in the table. This value directly impacts memory usage. Count approximately
				50 bytes per entry, plus the size of a string if any.<br/>
				EXAMPLE: 50k
			</td>
		</tr>
		<tr><td>&nbsp;</td></tr>
		<?php 
if (haproxy_version() >= '1.6') {
    ?>
		<tr>
			<td colspan="2" valign="top" class="listtopic">Email notifications</td>
		</tr>		
		<tr>
			<td valign="top" class="vncell">
				Mail level
			</td>
			<td class="vtable">
				<?php 
    echo_html_select('email_level', $a_sysloglevel, $pconfig['email_level']);
    ?>
				Define the maximum loglevel to send emails for.
			</td>
		</tr>
コード例 #2
0
ファイル: compile-vsftpd.php プロジェクト: BillTheBest/1.6.x
function create_package()
{
    $unix = new unix();
    $wget = $unix->find_program("wget");
    $tar = $unix->find_program("tar");
    $rm = $unix->find_program("rm");
    $cp = $unix->find_program("cp");
    $Architecture = Architecture();
    $version = haproxy_version();
    $debian_version = DebianVersion();
    mkdir("{$GLOBALS["WORKDIR"]}/usr/local/sbin", 0755, true);
    $f[] = "/usr/local/sbin/vsftpd";
    $f[] = "/usr/local/man/man8/vsftpd.8";
    $f[] = "/usr/man/man8/vsftpd.8";
    $f[] = "/usr/share/man/man5/vsftpd.conf.5";
    $f[] = "/usr/share/man/man8/vsftpd.8";
    while (list($num, $ligne) = each($f)) {
        if (is_dir($ligne)) {
            shell_exec("/bin/cp -rfd {$ligne}/* {$GLOBALS["WORKDIR"]}/{$ligne}/");
            continue;
        }
        if (!is_file($ligne)) {
            echo "{$ligne} no such file\n";
            continue;
        }
        $dir = dirname($ligne);
        echo "Installing {$ligne} in {$GLOBALS["WORKDIR"]}{$dir}/\n";
        if (!is_dir("{$GLOBALS["WORKDIR"]}{$dir}")) {
            @mkdir("{$GLOBALS["WORKDIR"]}{$dir}", 0755, true);
        }
        shell_exec("/bin/cp -fd {$ligne} {$GLOBALS["WORKDIR"]}{$dir}/");
    }
    if ($Architecture == 64) {
        $Architecture = "x64";
    }
    if ($Architecture == 32) {
        $Architecture = "i386";
    }
    echo "Compile Arch {$Architecture} v:{$GLOBALS["VERSION"]} Debian {$debian_version}\n";
    chdir("{$GLOBALS["WORKDIR"]}");
    $packagename = "vsftpd-{$Architecture}-debian{$debian_version}-{$GLOBALS["VERSION"]}.tar.gz";
    echo "Compressing....{$GLOBALS["WORKDIR"]}/{$packagename}\n";
    shell_exec("{$tar} -czf {$packagename} *");
    shell_exec("{$cp} {$GLOBALS["WORKDIR"]}/{$packagename} /root/");
    system_admin_events("{$GLOBALS["WORKDIR"]}/{$packagename}  ready...", __FUNCTION__, __FILE__, __LINE__);
}
コード例 #3
0
ファイル: compile-haproxy.php プロジェクト: BillTheBest/1.6.x
function create_package()
{
    $unix = new unix();
    $wget = $unix->find_program("wget");
    $tar = $unix->find_program("tar");
    $rm = $unix->find_program("rm");
    $cp = $unix->find_program("cp");
    $Architecture = Architecture();
    $version = haproxy_version();
    $debian_version = DebianVersion();
    mkdir("{$GLOBALS["WORKDIR"]}/usr/local/sbin", 0755, true);
    shell_exec("{$cp} -rfd /usr/local/sbin/haproxy {$GLOBALS["WORKDIR"]}/usr/local/sbin/haproxy");
    shell_exec("{$cp} -rfd /usr/local/sbin/haproxy-systemd-wrapper {$GLOBALS["WORKDIR"]}/usr/local/sbin/haproxy-systemd-wrapper");
    if ($Architecture == 64) {
        $Architecture = "x64";
    }
    if ($Architecture == 32) {
        $Architecture = "i386";
    }
    echo "Compile Arch {$Architecture} v:{$version} Debian {$debian_version}\n";
    chdir("{$GLOBALS["WORKDIR"]}");
    $packagename = "haproxy-{$Architecture}-debian{$debian_version}-{$version}.tar.gz";
    echo "Compressing....{$GLOBALS["WORKDIR"]}/{$packagename}\n";
    shell_exec("{$tar} -czf {$packagename} *");
    shell_exec("{$cp} {$GLOBALS["WORKDIR"]}/{$packagename} /root/");
    system_admin_events("{$GLOBALS["WORKDIR"]}/{$packagename}  ready...", __FUNCTION__, __FILE__, __LINE__);
    if (is_file("/root/ftp-password")) {
        echo "{$GLOBALS["WORKDIR"]}/{$packagename} is now ready to be uploaded\n";
        shell_exec("curl -T {$GLOBALS["WORKDIR"]}/{$packagename} ftp://www.articatech.net/download/ --user " . @file_get_contents("/root/ftp-password"));
        system_admin_events("Uploading {$packagename} done.", __FUNCTION__, __FILE__, __LINE__);
        if (is_file("/root/rebuild-artica")) {
            shell_exec("{$wget} \"" . @file_get_contents("/root/rebuild-artica") . "\" -O /tmp/rebuild.html");
        }
    }
    $took = $unix->distanceOfTimeInWords($t, time(), true);
    system_admin_events("Installing the new HaProxy {$version} success took:{$took}", __FUNCTION__, __FILE__, __LINE__, "software");
}
コード例 #4
0
ファイル: exec.status.php プロジェクト: BillTheBest/1.6.x
function haproxy()
{
    if (!$GLOBALS["CLASS_USERS"]->HAPROXY_INSTALLED) {
        return;
    }
    include_once dirname(__FILE__) . "/ressources/class.mysql.inc";
    if (!class_exists("mysql")) {
        return;
    }
    $enabled = 0;
    if (is_file("/etc/haproxy/haproxy.cfg")) {
        $sql = "SELECT COUNT(*) as tcount FROM haproxy WHERE enabled=1";
        $q = new mysql();
        $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
        if ($ligne["tcount"] > 0) {
            $enabled = 1;
        }
    }
    $pid_path = "/var/run/haproxy.pid";
    $l[] = "[APP_HAPROXY]";
    $l[] = "service_name=APP_HAPROXY";
    $l[] = "master_version=" . haproxy_version();
    $l[] = "service_cmd=/etc/init.d/haproxy";
    $l[] = "service_disabled={$enabled}";
    $l[] = "pid_path={$pid_path}";
    $l[] = "watchdog_features=1";
    $l[] = "family=network";
    if ($enabled == 0) {
        $l[] = "";
        return implode("\n", $l);
        return;
    }
    if (is_file($pid_path)) {
        $pids = explode("\n", @file_get_contents($pid_path));
        while (list($index, $line) = each($pids)) {
            $line = str_replace("\r", "", $line);
            $line = str_replace("\n", "", $line);
            if (!is_numeric(trim($line))) {
                continue;
            }
            if ($GLOBALS["VERBOSE"]) {
                echo "{$pid_path} = {$line}\n";
            }
            if ($GLOBALS["CLASS_UNIX"]->process_exists($line)) {
                $PPID = $GLOBALS["CLASS_UNIX"]->PPID_OF($line);
                if ($GLOBALS["VERBOSE"]) {
                    echo "{$line} ->running PPID:{$PPID}\n";
                }
                $PIDX[trim($line)] = $line;
            }
        }
    }
    if (!$GLOBALS["CLASS_UNIX"]->process_exists($PPID)) {
        if (!$GLOBALS["DISABLE_WATCHDOG"]) {
            $cmd = trim("{$GLOBALS["NICE"]} {$GLOBALS["PHP5"]} " . dirname(__FILE__) . "/exec.haproxy.php --start >/dev/null 2>&1 &");
            shell_exec2($cmd);
        }
        $l[] = "";
        return implode("\n", $l);
    }
    $l[] = GetMemoriesOf($PPID);
    $l[] = "";
    return implode("\n", $l);
    return;
}