本文整理汇总了PHP中unix::PIDOF方法的典型用法代码示例。如果您正苦于以下问题:PHP unix::PIDOF方法的具体用法?PHP unix::PIDOF怎么用?PHP unix::PIDOF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unix
的用法示例。
在下文中一共展示了unix::PIDOF方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: XZARAFA_GATEWAY_PID
function XZARAFA_GATEWAY_PID()
{
$unix = new unix();
$pid = $unix->get_pid_from_file("/var/run/zarafa-gateway.pid");
if ($unix->process_exists($pid)) {
return $pid;
}
return $unix->PIDOF($unix->find_program("zarafa-gateway"));
}
示例2: PID_NUM
function PID_NUM()
{
$filename = PID_PATH();
$pid = trim(@file_get_contents($filename));
$unix = new unix();
if ($unix->process_exists($pid)) {
return $pid;
}
return $unix->PIDOF($unix->find_program("memcached"));
}
示例3: SQUID_PID
function SQUID_PID()
{
$unix = new unix();
$squidbin = $unix->LOCATE_SQUID_BIN();
$pid = $unix->get_pid_from_file($unix->LOCATE_SQUID_PID());
if (!$unix->process_exists($pid)) {
$pid = $unix->PIDOF($squidbin);
}
return $pid;
}
示例4: GET_PID
function GET_PID()
{
$unix = new unix();
$pid = $unix->get_pid_from_file("/var/run/rsyslogd.pid");
if ($unix->process_exists($pid)) {
return $pid;
}
$rsyslogd = $unix->find_program("rsyslogd");
return $unix->PIDOF($rsyslogd);
}
示例5: GETPID
function GETPID()
{
$unix = new unix();
if (is_file('/etc/artica-postfix/exec.hotspot-tail.php.pid')) {
$pid = @file_get_contents("'/etc/artica-postfix/exec.hotspot-tail.php.pid'");
}
if ($unix->process_exists($pid)) {
return $pid;
}
$pid = $unix->PIDOF("/bin/hotspot-tail");
if ($unix->process_exists($pid)) {
return $pid;
}
return $unix->PIDOF_PATTERN("exec.hotspot-tail.php");
}
示例6: PID_NUM
function PID_NUM()
{
$filename = PID_PATH();
$pid = trim(@file_get_contents($filename));
$unix = new unix();
if ($unix->process_exists($pid)) {
return $pid;
}
return $unix->PIDOF($unix->LOCATE_STUNNEL());
}
示例7: PID_NUM
function PID_NUM()
{
$unix = new unix();
$Masterbin = $unix->find_program("conntrackd");
if (!is_file($Masterbin)) {
return 0;
}
return $unix->PIDOF($Masterbin);
}
示例8: SingleInstance_pid
function SingleInstance_pid()
{
$unix = new unix();
$pidpath = "/var/run/milter-greylist/milter-greylist.pid";
$pid = $unix->get_pid_from_file($pidpath);
if ($unix->process_exists($pid)) {
return $pid;
}
return $unix->PIDOF($unix->find_program("milter-greylist"));
}
示例9: zipproxy_pid
function zipproxy_pid()
{
$unix = new unix();
$masterbin = $unix->find_program("ziproxy");
$pid = $unix->get_pid_from_file('/var/run/squid/ziproxy.pid');
if ($unix->process_exists($pid)) {
return $pid;
}
return $unix->PIDOF($masterbin);
}
示例10: Kav4ProxyUpdate
function Kav4ProxyUpdate()
{
$unix = new unix();
$cmd = "/opt/kaspersky/kav4proxy/bin/kav4proxy-keepup2date";
$type = $_GET["type"];
if ($type == "milter") {
if (is_file("/opt/kav/5.6/kavmilter/bin/keepup2date")) {
$cmd = "/opt/kav/5.6/kavmilter/bin/keepup2date";
}
if (is_file("/opt/kaspersky/kav4lms/bin/kav4lms-keepup2date")) {
shell_exec("/usr/share/artica-postfix/bin/artica-install --kavm4mls-info");
$cmd = "/opt/kaspersky/kav4lms/bin/kav4lms-keepup2date";
}
}
if ($type == "kas") {
$cmd = "/usr/local/ap-mailfilter3/bin/keepup2date -c /usr/local/ap-mailfilter3/etc/keepup2date.conf";
}
$pid = $unix->PIDOF(basename($cmd));
if (strlen($pid) > 0) {
return;
}
@file_put_contents("/usr/share/artica-postfix/ressources/logs/Kav4ProxyUpdate", "{waiting}...\nSelected {$type}: " . basename($cmd) . "\n\n");
@chmod("/usr/share/artica-postfix/ressources/logs/Kav4ProxyUpdate", 0775);
sys_THREAD_COMMAND_SET("{$cmd} >>/usr/share/artica-postfix/ressources/logs/Kav4ProxyUpdate");
}
示例11: PID_NUM
function PID_NUM()
{
$unix = new unix();
$pid = $unix->get_pid_from_file("/var/run/clamav/clamd.pid");
if ($unix->process_exists($pid)) {
return $pid;
}
$Masterbin = $unix->find_program("clamd");
return $unix->PIDOF($Masterbin);
}
示例12: PID_NUM
function PID_NUM()
{
$unix = new unix();
$pid = $unix->get_pid_from_file("/home/ArticaStatsDB/postmaster.pid");
if ($unix->process_exists($pid)) {
return $pid;
}
return $unix->PIDOF("/usr/local/ArticaStats/bin/postgres");
}
示例13: ParseRetranslatorLogs
function ParseRetranslatorLogs()
{
$unix = new unix();
if ($unix->PIDOF("/usr/share/artica-postfix/bin/retranslator.bin") > 0) {
return;
}
$dir = "/var/log/kretranslator";
if (!is_dir($dir)) {
return null;
}
$unix = new unix();
$files = $unix->DirFiles($dir);
while (list($num, $file) = each($files)) {
if (!preg_match("#retranslator-([0-9\\-]+)_([0-9]+)-([0-9]+)-([0-9]+).debug#", $file, $re)) {
continue;
}
$date = "{$re[1]} {$re[2]}:{$re[3]}:{$re[4]}";
$NumberofFilesUpdated = NumberofRestransFilesUpdated("{$dir}/{$file}");
if ($NumberofFilesUpdated[0] > 0) {
$subject = "Kaspersky Retranslator: {$NumberofFilesUpdated[0]} files updated ({$NumberofFilesUpdated[1]})";
send_email_events($subject, @file_get_contents("{$dir}/{$file}"), "KASPERSKY_UPDATES", $date);
@unlink("{$dir}/{$file}");
continue;
}
@unlink("{$dir}/{$file}");
}
}
示例14: DEFAULT_PID
function DEFAULT_PID()
{
$unix = new unix();
$pid = $unix->get_pid_from_file('/var/run/fetchmail.pid');
if ($unix->process_exists($pid)) {
return $pid;
}
$fetchmail = $unix->find_program("fetchmail");
return $unix->PIDOF($fetchmail);
}
示例15: ntopng_pid
function ntopng_pid()
{
$unix = new unix();
$masterbin = $unix->find_program("ntopng");
$pid = $unix->get_pid_from_file('/var/run/ntopng/ntopng.pid');
if ($unix->process_exists($pid)) {
return $pid;
}
return $unix->PIDOF($masterbin);
}