Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(core): source installation script fixes (#8341)
Browse files Browse the repository at this point in the history
* fix(core): replace missing php macros
* enh(core): update licenses
* fix(core): change rights on centreon cache folder
* fix(core): add centreon cache folder to conf generation step
* manage .env.local.php file transfer
* generate a random key
* enh(doc): update doc and add specific DB steps
  • Loading branch information
sc979 committed Feb 21, 2020
1 parent 296e5ab commit 5253f39
Show file tree
Hide file tree
Showing 20 changed files with 422 additions and 293 deletions.
30 changes: 13 additions & 17 deletions bin/centreon
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!@PHP_BIN@
<?php
/**
* Copyright 2005-2015 CENTREON
* Centreon is developped by : Julien Mathis and Romain Le Merlus under
/*
* Copyright 2005-2020 Centreon
* Centreon is developed by : Julien Mathis and Romain Le Merlus under
* GPL Licence 2.0.
*
* This program is free software; you can redistribute it and/or modify it under
Expand All @@ -20,11 +20,11 @@
* combined work based on this program. Thus, the terms and conditions of the GNU
* General Public License cover the whole combination.
*
* As a special exception, the copyright holders of this program give CENTREON
* As a special exception, the copyright holders of this program give Centreon
* permission to link this program with independent modules to produce an executable,
* regardless of the license terms of these independent modules, and to copy and
* distribute the resulting executable under terms of CENTREON choice, provided that
* CENTREON also meet, for each linked independent module, the terms and conditions
* distribute the resulting executable under terms of Centreon choice, provided that
* Centreon also meet, for each linked independent module, the terms and conditions
* of the license of that module. An independent module is a module which is not
* derived from this program. If you modify this program, you may extend this
* exception to your version of the program, but you are not obliged to do so. If you
Expand All @@ -38,18 +38,18 @@ $debug = 0;

ini_set("display_errors", "Off");

require_once realpath(dirname(__FILE__) . '/../config/centreon.config.php');
require_once realpath(__DIR__ . "/../config/centreon.config.php");
require_once realpath(__DIR__ . "/../bootstrap.php");

define('APPLICATION_PATH', realpath(dirname(__FILE__)));
define('APPLICATION_PATH', realpath(__DIR__));
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../lib'),
realpath(APPLICATION_PATH . '/../www/class/centreon-clapi'),
get_include_path()
)));

define('_CLAPI_LIB_', realpath(dirname(__FILE__)) . "/../lib");
define('_CLAPI_CLASS_', realpath(dirname(__FILE__)) . "/../www/class/centreon-clapi");
define('_CLAPI_LIB_', realpath(__DIR__ . "/../lib"));
define('_CLAPI_CLASS_', realpath(__DIR__ . "/../www/class/centreon-clapi"));

global $version;

Expand Down Expand Up @@ -121,9 +121,9 @@ $db_storage = $dependencyInjector['realtime_db'];
*/
CentreonClapi\CentreonUtils::setUserName($options['u']);
$api = CentreonClapi\CentreonAPI::getInstance(
(isset($options["u"]) ? $options["u"] : ""),
(isset($options["p"]) ? $options["p"] : ""),
(isset($options["a"]) ? $options["a"] : ""),
($options["u"] ?? ""),
($options["p"] ?? ""),
($options["a"] ?? ""),
$centreon_path,
$options,
$dependencyInjector
Expand All @@ -138,7 +138,6 @@ if (isset($options["V"])) {
}

if (isset($options["w"]) && $options['o'] == "CentreonWorker" && !empty($options["u"]) && !empty($options["p"])){

$api->setLogin($options["u"]);
$api->setPassword($options["p"]);
$api->checkUser($useSha1, true);
Expand All @@ -157,9 +156,6 @@ if (isset($options["w"]) && $options['o'] == "CentreonWorker" && !empty($options
}
}

/**
* Now works
*/
if ($api->login == "" || $api->password == "") {
if (file_exists($_SERVER["HOME"] . "/.centreonApi")) {
$uid = posix_getpwuid(fileowner($_SERVER["HOME"] . "/.centreonApi"));
Expand Down
18 changes: 18 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#!@PHP_BIN@
<?php
/*
* Copyright 2005 - 2020 Centreon (https://www.centreon.com/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : contact@centreon.com
*
*/

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
Expand Down
4 changes: 2 additions & 2 deletions doc/en/installation/common/install_packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ option in **/etc/my.cnf** because it will *not* work. Run the commands:
**For MariaDB**: ::

# mkdir -p /etc/systemd/system/mariadb.service.d/
# echo -ne "[Service]\nLimitNOFILE=32000\n" | tee /etc/systemd/system/mariadb.service.d/limits.conf
# echo -ne "[Service]\nLimitNOFILE=32000\n" | tee /etc/systemd/system/mariadb.service.d/centreon.conf
# systemctl daemon-reload
# systemctl restart mysql

**For MySQL**: ::

# mkdir -p /etc/systemd/system/mysqld.service.d
# echo -ne "[Service]\nLimitNOFILE=32000\n" | tee /etc/systemd/system/mysqld.service.d/limits.conf
# echo -ne "[Service]\nLimitNOFILE=32000\n" | tee /etc/systemd/system/mysqld.service.d/centreon.conf
# systemctl daemon-reload
# systemctl restart mysqld

Expand Down
1 change: 1 addition & 0 deletions doc/en/installation/common/web_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ In this case, you only need to define a password for the user accessing the Cent
[mysqld]
innodb_file_per_table=1
open_files_limit=32000
4. Restart the mysql service::

Expand Down
Loading

0 comments on commit 5253f39

Please sign in to comment.