Last-Update: 2013-12-15
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/class.cconfigfile.php
+++ b/frontends/php/include/classes/class.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';
 
 	public $configFile = null;
 	public $config = array();
 	public $error = '';
--- a/frontends/php/include/setup.inc.php
+++ b/frontends/php/include/setup.inc.php
@@ -442,9 +442,9 @@
 
 	function stage6() {
 		$this->setConfig('ZBX_CONFIG_FILE_CORRECT', true);
 
-		$config = new CConfigFile(Z::getInstance()->getRootDir().CConfigFile::CONFIG_FILE_PATH);
+		$config = new CConfigFile(CConfigFile::CONFIG_FILE_PATH);
 		$config->config = array(
 			'DB' => array(
 				'TYPE' => $this->getConfig('DB_TYPE'),
 				'SERVER' => $this->getConfig('DB_SERVER'),
@@ -509,9 +509,9 @@
 		$this->DISABLE_NEXT_BUTTON = !$this->getConfig('ZBX_CONFIG_FILE_CORRECT', false);
 		$this->HIDE_CANCEL_BUTTON = !$this->DISABLE_NEXT_BUTTON;
 
 
-		$table = array('Configuration file', BR(), '"'.Z::getInstance()->getRootDir().CConfigFile::CONFIG_FILE_PATH.'"',
+		$table = array('Configuration file', BR(), '"'.CConfigFile::CONFIG_FILE_PATH.'"',
 			BR(), 'created: ', $this->getConfig('ZBX_CONFIG_FILE_CORRECT', false)
 			? new CSpan(_('OK'), 'ok')
 			: new CSpan(_('Fail'), 'fail')
 		);
@@ -522,9 +522,9 @@
 			!$this->getConfig('ZBX_CONFIG_FILE_CORRECT', false)
 				? array($error_text, BR(), 'Please install it manually, or fix permissions on the conf directory.', BR(), BR(),
 					'Press the "Download configuration file" button, download the configuration file ',
 					'and save it as ', BR(),
-					'"'.Z::getInstance()->getRootDir().CConfigFile::CONFIG_FILE_PATH.'"', BR(), BR(),
+					'"'.CConfigFile::CONFIG_FILE_PATH.'"', BR(), BR(),
 					new CSubmit('save_config', 'Download configuration file'),
 					BR(), BR()
 				)
 				: array(
@@ -628,9 +628,9 @@
 			if (isset($_REQUEST['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 = array(
 					'DB' => array(
 						'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
@@ -288,9 +288,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();
 	}
 
--- a/frontends/php/include/classes/items/CHelpItems.php
+++ b/frontends/php/include/classes/items/CHelpItems.php
@@ -261,9 +261,9 @@
 					'description' => _('Check if file exists. 0 - file does not exist, 1 - file exists')
 				),
 				array(
 					'key' => 'vfs.file.md5sum[file]',
-					'description' => _('Calculate MD5 check sum of a given file. String MD5 hash of the file. Can be used for files less than 64MB, unsupported otherwise. Example: vfs.file.md5sum[/usr/local/etc/zabbix_agentd.conf]')
+					'description' => _('Calculate MD5 check sum of a given file. String MD5 hash of the file. Can be used for files less than 64MB, unsupported otherwise. Example: vfs.file.md5sum[/etc/zabbix/zabbix_agentd.conf]')
 				),
 				array(
 					'key' => 'vfs.file.regexp[file,regexp,<encoding>]',
 					'description' => _('Find string in a file. Matched string')
@@ -523,9 +523,9 @@
 					'description' => _('Check if file exists. 0 - file does not exist, 1 - file exists')
 				),
 				array(
 					'key' => 'vfs.file.md5sum[file]',
-					'description' => _('Calculate MD5 check sum of a given file. String MD5 hash of the file. Can be used for files less than 64MB, unsupported otherwise. Example: vfs.file.md5sum[/usr/local/etc/zabbix_agentd.conf]')
+					'description' => _('Calculate MD5 check sum of a given file. String MD5 hash of the file. Can be used for files less than 64MB, unsupported otherwise. Example: vfs.file.md5sum[/etc/zabbix/zabbix_agentd.conf]')
 				),
 				array(
 					'key' => 'vfs.file.regexp[file,regexp,<encoding>,<start line>,<end line>,<output>]',
 					'description' => _('Find string in a file. Matched string')
