本文整理汇总了PHP中sockets::DisableUfdbCat方法的典型用法代码示例。如果您正苦于以下问题:PHP sockets::DisableUfdbCat方法的具体用法?PHP sockets::DisableUfdbCat怎么用?PHP sockets::DisableUfdbCat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sockets
的用法示例。
在下文中一共展示了sockets::DisableUfdbCat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
function start($aspid = false, $verifdbs = false)
{
$unix = new unix();
$sock = new sockets();
$Masterbin = "/opt/ufdbcat/bin/ufdbcatdd";
if (!is_file($Masterbin)) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, ufdbguardd not installed\n";
}
return;
}
if (!$aspid) {
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$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["TITLENAME"]} Already Artica task running PID {$pid} since {$time}mn\n";
}
return;
}
@file_put_contents($pidfile, getmypid());
}
$pid = PID_NUM();
if ($unix->process_exists($pid)) {
$timepid = $unix->PROCCESS_TIME_MIN($pid);
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Service already started {$pid} since {$timepid}Mn...\n";
}
if ($GLOBALS["MONIT"]) {
@file_put_contents($GLOBALS["PID_PATH"], $pid);
}
return;
}
$DisableUfdbCat = $sock->DisableUfdbCat();
if ($DisableUfdbCat == 1) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} service disabled (see DisableUfdbCat)\n";
}
stop();
return;
}
$php5 = $unix->LOCATE_PHP5_BIN();
$sysctl = $unix->find_program("sysctl");
$echo = $unix->find_program("echo");
$nohup = $unix->find_program("nohup");
$kill = $unix->find_program("kill");
$cp = $unix->find_program("cp");
@mkdir("/etc/ufdbcat", 0755, true);
@mkdir("/var/log/ufdbcat", 0755, true);
@mkdir(dirname($GLOBALS["PID_PATH"]), 0755, true);
@chmod($GLOBALS["PID_PATH"], 0755);
@chmod($Masterbin, 0755);
build_progress("{starting_service}", 10);
CheckDirectories($verifdbs);
if (is_file("/var/log/ufdbcat/ufdbguardd.log")) {
@unlink("/var/log/ufdbcat/ufdbguardd.log");
}
if (is_file("/var/run/ufdbcat-03977")) {
@unlink("/var/run/ufdbcat-03977");
}
if ($unix->is_socket("/var/run/ufdbcat-03977")) {
@unlink("/var/run/ufdbcat-03977");
}
$AsCategoriesAppliance = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/AsCategoriesAppliance"));
$Threads = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/UfdbCatThreads"));
if ($Threads == 0) {
$Threads = 4;
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} pid path: {$GLOBALS["PID_PATH"]}\n";
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Threads:{$Threads}\n";
}
if (is_file("/opt/ufdbcat/bin/ufdbhttpd")) {
@unlink("/opt/ufdbcat/bin/ufdbhttpd");
}
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} ** Categories Appliance Mode ***\n";
}
$isRemoteSockets = isRemoteSockets();
if ($isRemoteSockets) {
if (!is_file("{$Masterbin}.sock")) {
@copy($Masterbin, "{$Masterbin}.sock");
}
$ufdbguardd = $unix->find_program("ufdbguardd");
if (!is_file($ufdbguardd)) {
if ($GLOBALS["OUTPUT"]) {
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Fatal ufdbguardd no such binary!!!\n";
}
return false;
}
@unlink($Masterbin);
@copy($ufdbguardd, $Masterbin);
}
if (!$isRemoteSockets) {
if (is_file("{$Masterbin}.sock")) {
@copy("{$Masterbin}.sock", $Masterbin);
@unlink("{$Masterbin}.sock");
//.........这里部分代码省略.........