Package: zabbix / 1:3.0.7+dfsg-3

config_frontend-conffile-in-etc.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Last-Update: 2016-02-13
Forwarded: not-needed
Author: Christoph Haas <haas@debian.org>
Reviewed-By: Dmitry Smirnov <onlyjob@member.fsf.org>
Description: Make Zabbix put its generated config file into /etc/zabbix

--- a/frontends/php/include/classes/core/CConfigFile.php
+++ b/frontends/php/include/classes/core/CConfigFile.php
@@ -23,9 +23,9 @@
 
 	const CONFIG_NOT_FOUND = 1;
 	const CONFIG_ERROR = 2;
 
-	const CONFIG_FILE_PATH = '/conf/zabbix.conf.php';
+	const CONFIG_FILE_PATH = '/etc/zabbix/zabbix.conf.php';
 
 	private static $supported_db_types = [
 		ZBX_DB_DB2 => true,
 		ZBX_DB_MYSQL => true,
--- a/frontends/php/include/classes/setup/CSetupWizard.php
+++ b/frontends/php/include/classes/setup/CSetupWizard.php
@@ -347,9 +347,9 @@
 
 	function stage5() {
 		$this->setConfig('ZBX_CONFIG_FILE_CORRECT', true);
 
-		$config_file_name = Z::getInstance()->getRootDir().CConfigFile::CONFIG_FILE_PATH;
+		$config_file_name = CConfigFile::CONFIG_FILE_PATH;
 		$config = new CConfigFile($config_file_name);
 		$config->config = [
 			'DB' => [
 				'TYPE' => $this->getConfig('DB_TYPE'),
@@ -516,9 +516,9 @@
 			if (hasRequest('save_config')) {
 				// make zabbix.conf.php downloadable
 				header('Content-Type: application/x-httpd-php');
 				header('Content-Disposition: attachment; filename="'.basename(CConfigFile::CONFIG_FILE_PATH).'"');
-				$config = new CConfigFile(Z::getInstance()->getRootDir().CConfigFile::CONFIG_FILE_PATH);
+				$config = new CConfigFile(CConfigFile::CONFIG_FILE_PATH);
 				$config->config = [
 					'DB' => [
 						'TYPE' => $this->getConfig('DB_TYPE'),
 						'SERVER' => $this->getConfig('DB_SERVER'),
--- a/frontends/php/include/classes/core/ZBase.php
+++ b/frontends/php/include/classes/core/ZBase.php
@@ -281,9 +281,9 @@
 	/**
 	 * Load zabbix config file.
 	 */
 	protected function loadConfigFile() {
-		$configFile = $this->getRootDir().CConfigFile::CONFIG_FILE_PATH;
+		$configFile = CConfigFile::CONFIG_FILE_PATH;
 		$config = new CConfigFile($configFile);
 		$this->config = $config->load();
 	}