本文整理汇总了PHP中createRestartFile函数的典型用法代码示例。如果您正苦于以下问题:PHP createRestartFile函数的具体用法?PHP createRestartFile怎么用?PHP createRestartFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createRestartFile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dosyncToSystemPost
function dosyncToSystemPost()
{
global $sgbl;
$ret = lxshell_return("rndc", "reload");
if ($ret) {
createRestartFile("bind");
}
}
示例2: remove_lighttpd_error_log
function remove_lighttpd_error_log()
{
$f = "/home/kloxo/httpd/lighttpd/error.log";
$s = lxfile_size($f);
if ($s > 50 * 1024 * 1024) {
lunlink($f);
createRestartFile("lighttpd");
}
}
示例3: installMe
static function installMe()
{
$ret = lxshell_return("yum", "-y", "install", "spamassassin");
if ($ret) {
throw new lxexception('install_spamassassin_failed', 'parent');
}
lxshell_return("chkconfig", "spamassassin", "on");
lxfile_cp("../file/sysconfig_spamassassin", "/etc/sysconfig/spamassassin");
createRestartFile("spamassassin");
}
示例4: createDiruserfile
function createDiruserfile()
{
global $gbl, $sgbl, $login, $ghtml;
$result = $this->main->__var_davuser;
$res = null;
foreach ($result as $r) {
$cr = crypt($r['realpass']);
//$cr = $r['realpass'];
$res .= "{$r['username']}:{$cr}\n";
}
lxfile_mkdir("__path_httpd_root/{$this->main->getParentName()}/__davuser");
lfile_put_contents("__path_httpd_root/{$this->main->getParentName()}/__davuser/davuser", $res);
$this->createDavSuexec();
$string = $this->createVirtualHost();
lfile_put_contents("/home/kloxo/httpd/webdisk/virtualhost.conf", $string);
createRestartFile("webdisk");
}
示例5: createDhcpConfFile
static function createDhcpConfFile($slist)
{
$list = os_get_allips();
foreach ($list as $l) {
$base = strtil($l, ".");
$subnet[$base] = null;
}
$string = null;
$string .= "ddns-update-style interim;\n";
$string .= "ignore client-updates;\n\n\n";
$string .= self::getSubnetString($k, $slist);
/*
foreach($subnet as $k => $v) {
$string .= self::getSubnetString($k, $slist);
}
*/
foreach ($slist as $s) {
$string .= self::getHostString($s);
}
lfile_put_contents("/etc/dhcpd.conf", $string);
createRestartFile("dhcpd");
}
示例6: dbactionUpdate
function dbactionUpdate($subaction)
{
$name = sslcert::getSslCertnameFromIP($this->main->nname);
$path = "__path_ssl_root";
$contentscer = $this->main->text_crt_content;
$contentskey = $this->main->text_key_content;
$contentsca = trim($this->main->text_ca_content);
if (!$contentscer || !$contentskey) {
throw new lxException("certificate_key_file_empty", '');
}
sslcert::checkAndThrow($contentscer, $contentskey, $name);
lfile_put_contents("{$path}/{$name}.crt", $contentscer);
lfile_put_contents("{$path}/{$name}.key", $contentskey);
$contentpem = "{$contentscer}\n{$contentskey}";
lfile_put_contents("{$path}/{$name}.pem", $contentpem);
if ($contentsca) {
lfile_put_contents("{$path}/{$name}.ca", $contentsca);
} else {
lxfile_cp("htmllib/filecore/program.ca", "{$path}/{$name}.ca");
}
createRestartFile($this->main->__var_webdriver);
}
示例7: switchProgramPost
static function switchProgramPost($old, $new)
{
createRestartFile($new);
}
示例8: switchProgramPost
static function switchProgramPost($old, $new)
{
if ($new === 'spamassassin') {
lxfile_cp("../file/sysconfig_spamassassin", "/etc/sysconfig/spamassassin");
createRestartFile("spamassassin");
}
}
示例9: updatecleanup_main
function updatecleanup_main()
{
global $argc, $argv;
global $gbl, $sgbl, $login, $ghtml;
$program = $sgbl->__var_program_name;
$opt = parse_opt($argv);
if ($opt['type'] === 'master') {
initProgram('admin');
$flg = "__path_program_start_vps_flag";
if (!lxfile_exists($flg)) {
set_login_skin_to_feather();
}
} else {
$login = new Client(null, null, 'update');
}
log_cleanup("*** Executing Update (cleanup) - BEGIN ***");
// Do things that is needed before the cleanup starts.
print "########################################\n";
print "## Executing PreCleanup ##\n";
print "########################################\n";
doBeforeUpdate();
print "########################################\n";
print "## Finished PreCleanup ##\n";
print "########################################\n";
if (lxfile_exists('.git')) {
log_cleanup('- Development found!');
}
if ($opt['type'] === 'master') {
$sgbl->slave = false;
if (!is_secondary_master()) {
updateDatabaseProperly();
fixDataBaseIssues();
doUpdates();
lxshell_return("__path_php_path", "../bin/common/driverload.php");
}
update_all_slave();
cp_dbfile();
} else {
$sgbl->slave = true;
}
if (!is_secondary_master()) {
updatecleanup();
}
if ($opt['type'] === 'master') {
lxfile_touch("__path_program_start_vps_flag");
}
// issue #716 -- [beta] Unresolved dependency on Apache version
// --- remove httpd-itk rpm (from webtatic.repo or others) because may conflict with
// httpd 2.2.21 that include mpm itk beside mpm worker and event
exec("rpm -q httpd-itk | grep -i 'not installed'", $out, $ret);
// --- not work with !$ret
if ($ret !== 0) {
log_cleanup("Remove httpd-itk rpm package");
log_cleanup("- Remove httpd-itk");
exec("rpm -e httpd-itk --nodeps");
exec("rpm -q httpd | grep -i 'not installed'", $out2, $ret2);
if ($ret2 === 0) {
log_cleanup("- Reinstall httpd");
exec("yum reinstall httpd -y");
}
}
// MR -- mysql not start after kloxo slave install
log_cleanup("Preparing MySQL service");
log_cleanup("- MySQL activated");
exec("chkconfig mysqld on");
log_cleanup("- MySQL restarted");
exec("service mysqld restart");
// MR -- importance for update from 6.1.6 or previous where change apache/lighttpd structure
// or others for next version
$slist = array("httpd*", "lighttpd*", "bind*", "djbdns*", "pure-ftpd*", "php*", "vpopmail", "courier-imap-toaster", "courier-authlib-toaster", "qmail", "safecat", "spamassassin", "bogofilter", "ezmlm-toaster", "autorespond-toaster", "clamav-toaster");
setUpdateServices($slist);
// MR -- use this trick for qmail non-daemontools based
log_cleanup("Preparing some services again");
log_cleanup("- courier-imap enabled and restart queue");
exec("chkconfig courier-imap on");
createRestartFile("courier-imap");
log_cleanup("- qmail enabled and restart queue");
exec("chkconfig qmail on");
createRestartFile("qmail");
$fixapps = array("dns", "web", "php", "mail", "ftpuser", "vpop");
setUpdateConfigWithVersionCheck($fixapps, $opt['type']);
// --- for anticipate change xinetd listing
exec("service xinetd restart");
}
示例10: rotateLog
static function rotateLog($processedir, $file)
{
$stat = stat($file);
if ($stat['size'] >= 10 * 1024 * 1024) {
lxfile_mv($file, getNotexistingFile($processedir, basename($file)));
createRestartFile("syslog");
}
$list = lscandir_without_dot($processedir);
foreach ($list as $k) {
$file = "{$processedir}/{$k}";
$stat = stat($file);
if ($stat['mtime'] < time() - 10 * 24 * 3600) {
dprint("deleting old log {$file}\n");
lxfile_rm($file);
}
}
}
示例11: dosyncToSystemPost
function dosyncToSystemPost()
{
global $gbl, $sgbl, $login, $ghtml;
if (!$this->isOn('norestart')) {
createRestartFile("apache");
}
}
示例12: collect_quota_later
function collect_quota_later()
{
createRestartFile("lxcollectquota");
}
示例13: updatecleanup_main
function updatecleanup_main()
{
global $argc, $argv;
global $gbl, $sgbl, $login, $ghtml;
$program = $sgbl->__var_program_name;
$opt = parse_opt($argv);
if ($opt['type'] === 'master') {
initProgram('admin');
$flg = "__path_program_start_vps_flag";
if (!lxfile_exists($flg)) {
set_login_skin_to_feather();
}
} else {
$login = new Client(null, null, 'update');
}
log_cleanup("*** Executing Update (cleanup) - BEGIN ***");
//
// Check for lxlabs yum repo file and if exists
// Change to lxcenter repo file
//
if (lxfile_exists("/etc/yum.repos.d/lxlabs.repo")) {
log_cleanup("- Deleting old lxlabs yum repo");
lxfile_mv("/etc/yum.repos.d/lxlabs.repo", "/etc/yum.repos.d/lxlabs.repo.lxsave");
exec("rm -f /etc/yum.repos.d/lxlabs.repo");
log_cleanup("- Removed lxlabs.repo");
log_cleanup("- Installing lxcenter.repo");
exec("wget -O /etc/yum.repos.d/lxcenter.repo http://download.lxcenter.org/lxcenter.repo");
log_cleanup("- Installing yum-protectbase plugin");
exec("yum install -y -q yum-protectbase");
}
// Fix #388 - phpMyAdmin config.inc.php permission
$correct_perm = "0644";
$check_perm = substr(decoct(fileperms("/usr/local/lxlabs/{$program}/httpdocs/thirdparty/phpMyAdmin/config.inc.php")), 2);
if ($check_perm != $correct_perm) {
lxfile_unix_chmod("/usr/local/lxlabs/{$program}/httpdocs/thirdparty/phpMyAdmin/config.inc.php", "0644");
}
//
if (lxfile_exists(".svn")) {
log_cleanup("- SVN Found... Exiting");
exit;
}
if ($opt['type'] === 'master') {
$sgbl->slave = false;
if (!is_secondary_master()) {
updateDatabaseProperly();
fixDataBaseIssues();
doUpdates();
lxshell_return("__path_php_path", "../bin/common/driverload.php");
}
update_all_slave();
cp_dbfile();
} else {
$sgbl->slave = true;
}
if (!is_secondary_master()) {
updatecleanup();
}
if ($opt['type'] === 'master') {
lxfile_touch("__path_program_start_vps_flag");
}
// issue #716 -- [beta] Unresolved dependency on Apache version
// --- remove httpd-itk rpm (from webtatic.repo or others) because may conflict with
// httpd 2.2.21 that include mpm itk beside mpm worker and event
exec("rpm -q httpd-itk | grep -i 'not installed'", $out, $ret);
// --- not work with !$ret
if ($ret !== 0) {
log_cleanup("Remove httpd-itk rpm package");
log_cleanup("- Remove httpd-itk");
exec("rpm -e httpd-itk --nodeps");
exec("rpm -q httpd | grep -i 'not installed'", $out2, $ret2);
if ($ret2 === 0) {
log_cleanup("- Reinstall httpd");
exec("yum reinstall httpd -y");
}
}
// MR -- mysql not start after kloxo slave install
log_cleanup("Preparing MySQL service");
log_cleanup("- MySQL activated");
exec("chkconfig mysqld on");
log_cleanup("- MySQL restarted");
exec("service mysqld restart");
// MR -- importance for update from 6.1.6 or previous where change apache/lighttpd structure
// or others for next version
$slist = array("httpd*", "lighttpd*", "bind*", "djbdns*", "pure-ftpd*", "php*", "vpopmail", "courier-imap-toaster", "courier-authlib-toaster", "qmail", "safecat", "spamassassin", "bogofilter", "ezmlm-toaster", "autorespond-toaster", "clamav-toaster");
setUpdateServices($slist);
// MR -- use this trick for qmail non-daemontools based
log_cleanup("Preparing some services again");
log_cleanup("- courier-imap enabled and restart queue");
exec("chkconfig courier-imap on");
createRestartFile("courier-imap");
log_cleanup("- qmail enabled and restart queue");
exec("chkconfig qmail on");
createRestartFile("qmail");
$fixapps = array("dns", "web", "php", "mail", "ftpuser", "vpop");
setUpdateConfigWithVersionCheck($fixapps, $opt['type']);
// --- for anticipate change xinetd listing
exec("service xinetd restart");
}
示例14: dosyncToSystemPost
function dosyncToSystemPost()
{
global $sgbl;
createRestartFile("djbdns");
}
示例15: findTotaltrafficwebUsage
static function findTotaltrafficwebUsage($driverapp, $statsprog, $list, $oldtime, $newtime)
{
// run awstats only if it is today.
global $gbl, $sgbl, $login, $ghtml;
if ($sgbl->isDebug()) {
if (time() - $newtime < 24 * 3600 * 2) {
self::run_awstats($statsprog, $list);
}
} else {
self::run_awstats($statsprog, $list);
}
if (!isset($oldtime)) {
return null;
}
foreach ($list as $d) {
$tlist[$d->nname] = self::getweb_usage($d->nname, $d->customer_name, $oldtime, $newtime, $d);
}
foreach ($tlist as $key => $t) {
if (!isset($t)) {
$t = 0;
}
$temp[$key] = $t;
}
dprintr($temp);
createRestartFile($driverapp);
return $temp;
}