本文整理汇总了PHP中isvalidpid函数的典型用法代码示例。如果您正苦于以下问题:PHP isvalidpid函数的具体用法?PHP isvalidpid怎么用?PHP isvalidpid使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isvalidpid函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
header("Expires: " . gmdate("D, j M Y H:i:s", time()) . " GMT");
header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
*/
require_once "guiconfig.inc";
class QueueStats
{
public $queuename;
public $queuelength;
public $pps;
public $bandwidth;
public $borrows;
public $suspends;
public $drops;
}
if (!file_exists("{$g['varrun_path']}/qstats.pid") || !isvalidpid("{$g['varrun_path']}/qstats.pid")) {
/* Start in the background so we don't hang up the GUI */
mwexec_bg("/usr/local/sbin/qstats -p {$g['varrun_path']}/qstats.pid");
/* Give it a moment to start up */
sleep(1);
}
$fd = @fsockopen("unix://{$g['varrun_path']}/qstats");
if (!$fd) {
$error = gettext("Something wrong happened during communication with stat gathering.");
} else {
$stats = "";
while (!feof($fd)) {
$stats .= fread($fd, 4096);
}
fclose($fd);
@file_put_contents("{$g['tmp_path']}/qstats", $stats);
示例2: sprintf
$pkg_success_txt = sprintf(gettext('<b>%1$s</b> reinstallation successfully completed.'), $pkgname);
$pkg_fail_txt = sprintf(gettext('<b>%1$s</b> reinstallation failed!'), $pkgname);
$pkg_wait_txt = sprintf(gettext('Please wait while the reinstallation of <b>%1$s</b> completes.'), $pkgname);
} else {
$panel_heading_txt = gettext("Package Installation");
$pkg_success_txt = sprintf(gettext('<b>%1$s</b> installation successfully completed.'), $pkgname);
$pkg_fail_txt = sprintf(gettext('<b>%1$s</b> installation failed!'), $pkgname);
$pkg_wait_txt = sprintf(gettext('Please wait while the installation of <b>%1$s</b> completes.'), $pkgname);
}
}
}
}
if ($confirmed) {
// XXX: What if the user navigates away from this page and then comes back via his/her "Back" button?
$pidfile = $g['varrun_path'] . '/' . $g['product_name'] . '-upgrade.pid';
if (isvalidpid($pidfile)) {
$start_polling = true;
}
?>
<input type="hidden" name="id" value="<?php
echo $_REQUEST['id'];
?>
" />
<input type="hidden" name="mode" value="<?php
echo $pkgmode;
?>
" />
<input type="hidden" name="completed" value="true" />
<input type="hidden" name="confirmed" value="true" />
<input type="hidden" id="reboot_needed" name="reboot_needed" value="no" />
示例3: install_cron_job
install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "*", "*", "*");
break;
case 'weekly':
install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "*", "*", "0");
break;
case 'monthly':
// fall through
// fall through
default:
install_cron_job("/usr/bin/nice -n20 /etc/rc.update_bogons.sh", true, "1", "3", "1", "*", "*");
}
$config['system']['bogons']['interval'] = $_POST['bogonsinterval'];
}
write_config();
// Kill filterdns when value changes, filter_configure() will restart it
if ($old_aliasesresolveinterval != $config['system']['aliasesresolveinterval'] && isvalidpid("{$g['varrun_path']}/filterdns.pid")) {
killbypid("{$g['varrun_path']}/filterdns.pid");
}
$retval = 0;
$retval = filter_configure();
if (stristr($retval, "error") != true) {
$savemsg = get_std_save_message($retval);
$class = 'success';
} else {
$savemsg = $retval;
$class = 'warning';
}
}
}
$pgtitle = array(gettext("System"), gettext("Advanced"), htmlspecialchars(gettext("Firewall & NAT")));
include "head.inc";
示例4: filter_configure
/**
* Wrapper for filter_configure()
*
* @param string $username
* @param string $password
*
* @return bool
*/
public function filter_configure($username, $password)
{
$this->auth($username, $password);
global $g, $config;
filter_configure();
system_routing_configure();
setup_gateways_monitor();
relayd_configure();
require_once "openvpn.inc";
openvpn_resync_all();
/*
* The DNS Resolver and the DNS Forwarder may both be active so
* long as * they are running on different ports.
* See ticket #5882
*/
if (isset($config['dnsmasq']['enable'])) {
/* Configure dnsmasq but tell it NOT to restart DHCP */
services_dnsmasq_configure(false);
} else {
/* kill any running dnsmasq instance */
if (isvalidpid("{$g['varrun_path']}/dnsmasq.pid")) {
sigkillbypid("{$g['varrun_path']}/dnsmasq.pid", "TERM");
}
}
if (isset($config['unbound']['enable'])) {
/* Configure unbound but tell it NOT to restart DHCP */
services_unbound_configure(false);
} else {
/* kill any running Unbound instance */
if (isvalidpid("{$g['varrun_path']}/unbound.pid")) {
sigkillbypid("{$g['varrun_path']}/unbound.pid", "TERM");
}
}
/*
* Call this separately since the above are manually set to
* skip the DHCP restart they normally perform.
* This avoids restarting dhcpd twice as described on
* ticket #3797
*/
services_dhcpd_configure();
local_sync_accounts();
return true;
}