[zabbix] New release 2.2.2, DB files sub-packages, zabbixsrv split

Volker Fröhlich volter at fedoraproject.org
Mon Feb 17 16:43:18 UTC 2014


commit 5ec74b3f00b073625ff2271dcee205a61a9758e9
Author: Volker Fröhlich <volker27 at gmx.at>
Date:   Mon Feb 17 17:41:52 2014 +0100

    New release 2.2.2, DB files sub-packages, zabbixsrv split
    
        - New major release
        - Preserve timestamp on all install commands
        - Provide bundled md5-deutsch
        - Add noarch sub-packages for DB files
        - Correct directory permissions
        - Correct Conflicts directives
        - Correct /var/lib/zabbixsrv owner and permissions
        - Use dir directive for home directories and their sub-directories
        - Update config patch
        - Provide "zabbix"
        - Add libxml2-devel as BR for VMware monitoring and --with-libxml2 flag
        - Move user zabbixsrv to his own group
          - Split tmpfiles.d, thus solve BZ#982001
          - Split lock, log and run locations
          - Adapt ownership and permissions
        - Update README

 sources                                           |    2 +-
 zabbix-2.0.2-config.patch                         |   22 ---
 zabbix-2.1.9-config.patch                         |   72 +++++++
 zabbix-fedora.README => zabbix-fedora-epel.README |   94 ++++++++--
 zabbix-logrotate.in                               |    6 +-
 zabbix-proxy-mysql.service                        |    2 +-
 zabbix-proxy-pgsql.service                        |    2 +-
 zabbix-proxy-sqlite3.service                      |    2 +-
 zabbix-tmpfiles-zabbix.conf                       |    1 +
 zabbix-tmpfiles-zabbixsrv.conf                    |    1 +
 zabbix-tmpfiles.conf                              |    1 -
 zabbix.spec                                       |  207 +++++++++++++++------
 12 files changed, 306 insertions(+), 106 deletions(-)
---
diff --git a/sources b/sources
index 9ab4c4c..3f093f6 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-71dbe3737daf554daacb90933d611a07  zabbix-2.0.11-free.tar.gz
+4150290ed42c84f030e4d24832565e22  zabbix-2.2.2-free.tar.gz
diff --git a/zabbix-2.1.9-config.patch b/zabbix-2.1.9-config.patch
new file mode 100644
index 0000000..5254d77
--- /dev/null
+++ b/zabbix-2.1.9-config.patch
@@ -0,0 +1,72 @@
+diff -Nur zabbix-2.1.9/frontends/php/include/classes/class.cconfigfile.php zabbix-2.1.9-config/frontends/php/include/classes/class.cconfigfile.php
+--- zabbix-2.1.9/frontends/php/include/classes/class.cconfigfile.php	2013-11-04 17:35:47.000000000 +0100
++++ zabbix-2.1.9-config/frontends/php/include/classes/class.cconfigfile.php	2013-11-04 21:53:08.374100475 +0100
+@@ -24,7 +24,7 @@
+ 	const CONFIG_NOT_FOUND = 1;
+ 	const CONFIG_ERROR = 2;
+ 
+-	const CONFIG_FILE_PATH = '/conf/zabbix.conf.php';
++	const CONFIG_FILE_PATH = '/etc/zabbix/web/zabbix.conf.php';
+ 
+ 	public $configFile = null;
+ 	public $config = array();
+diff -Nur zabbix-2.1.9/frontends/php/include/classes/core/ZBase.php zabbix-2.1.9-config/frontends/php/include/classes/core/ZBase.php
+--- zabbix-2.1.9/frontends/php/include/classes/core/ZBase.php	2013-11-04 17:35:47.000000000 +0100
++++ zabbix-2.1.9-config/frontends/php/include/classes/core/ZBase.php	2013-11-04 21:53:08.376100479 +0100
+@@ -272,7 +272,7 @@
+ 	 * @throws Exception
+ 	 */
+ 	protected function setMaintenanceMode() {
+-		require_once $this->getRootDir().'/conf/maintenance.inc.php';
++		require_once '/etc/zabbix/web/maintenance.inc.php';
+ 
+ 		if (defined('ZBX_DENY_GUI_ACCESS')) {
+ 			$user_ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']))
+@@ -288,7 +288,7 @@
+ 	 * 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();
+ 	}
+diff -Nur zabbix-2.1.9/frontends/php/include/setup.inc.php zabbix-2.1.9-config/frontends/php/include/setup.inc.php
+--- zabbix-2.1.9/frontends/php/include/setup.inc.php	2013-11-04 17:35:47.000000000 +0100
++++ zabbix-2.1.9-config/frontends/php/include/setup.inc.php	2013-11-04 22:14:15.383310708 +0100
+@@ -429,7 +429,7 @@
+ 	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'),
+@@ -496,7 +496,7 @@
+ 		$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')
+@@ -509,7 +509,7 @@
+ 				? 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()
+ 				)
+@@ -615,7 +615,7 @@
+ 				// 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'),
diff --git a/zabbix-fedora.README b/zabbix-fedora-epel.README
similarity index 67%
rename from zabbix-fedora.README
rename to zabbix-fedora-epel.README
index 3a6f35e..5b6cdff 100644
--- a/zabbix-fedora.README
+++ b/zabbix-fedora-epel.README
@@ -13,9 +13,11 @@ Web configuration resides in /etc/zabbix/web. The configuration file can be
 created manually or by walking through the frontend setup tool, as soon as your
 httpd configuration allows. The directory also contains maintenance.inc.php!
 
+
 ==Log files==
 
-Log files are located in /var/log/zabbix.
+Log files are located in /var/log/zabbix for the agent and /var/log/zabbixsrv.
+for server and proxy.
 
 
 ==Where's my Flash watch?==
@@ -30,20 +32,7 @@ Fedora ships an Apache configuration file instead. This solutions performs
 better and is easier to maintain.
 
 
-=Additional changes from 1.8 to 2.0 in Fedora=
-
-==Zabbix 2.0 packages conflict Zabbix 1.8==
-
-This measure was taken because this major version introduces various database
-schema changes. A silent update would render Zabbix non-operational and possibly
-break the database. Besides that, Zabbix 2.0 server only works with other 2.0
-servers and proxies. Distributed setups must therefore be updated at the same
-time.
-
-http://www.zabbix.com/documentation/2.0/manual/appendix/compatibility
-
-
-==Two users==
+==Two users and groups==
 
 There's a certain security risk involved, running agent and proxy/server as the
 same user. This package therefore introduces an additional zabbixsrv user, used
@@ -78,7 +67,7 @@ different DB implementation!
 
 If you want to run multiple instances on the same host, do the following:
 
-- Copy the init scripts 
+- Copy or symlink the init scripts 
 - Create a file of the same name as the new init script in /etc/sysconfig
 - Define CFG_FILE="</path/to/daemon_config_file>" in this file
 - Create the file defined as CFG_FILE and adjust settings; in particular:
@@ -98,7 +87,7 @@ If you want to run multiple instances on the same host, do the following:
 
 ==Configuration changes==
 
-Zabbix 2.0 places configuration files directly in /etc. Symlinks preserve
+Zabbix 2.0/2.2 place configuration files directly in /etc. Symlinks preserve
 compatibility. maintenance.inc.php moved from /usr/share/zabbix/conf to
 /etc/zabbix/web.
 
@@ -124,7 +113,6 @@ to vote on it.
 
 Sadly it doesn't work with how Fedora's/EPEL's PHP is compiled.
 
---------------------------------------------------------------------------------
 
 =SELinux=
 
@@ -151,11 +139,77 @@ If you're using ping from the frontend:
 
 echo "avc:  denied  { setpgid } for  pid=31880 comm="zabbix_server_p" scontext=system_u:system_r:zabbix_t:s0 tcontext=system_u:system_r:zabbix_t:s0 tclass=process" | audit2allow -M zabbix_ping_frontend; sudo semodule -i zabbix_ping_frontend.pp
 
+
+=Additional packaging changes in Fedora/EPEL since 2.0=
+
+==Zabbix 2.2 conflicts 1.8 and 2.0==
+
+Please see the below section for the reason!
+
+
+==Agent init script/unit file name==
+For the sake of consistency between distributions, the agent init script,
+respectively the systemd unit file, was renamed to zabbix-agentd -- mind the
+trailing "d"! Symlinks with the old names are in place. Keep in mind, if
+you created a configuration file in /etc/sysconfig, the sourced file must
+the name of the init script you invoke! Consequently, if you decide to use
+zabbix-agentd in the future, copy or symlink this file.
+
+
+==zabbixsrv now has its own user group==
+
+zabbixsrv used to be a member of the zabbix user group. Completely fresh
+installations will create the zabbixsrv group and assign it as the primary
+group. If the user zabbixsrv already exists (upgrade from 2.0), the user group
+is replaced.
+
+
+==Log and lock file locations, group membership==
+
+All logs used to be in /var/log/zabbix. With zabbixsrv having its own
+user group, the logs are now split between /var/log/zabbix for the agent and
+/var/log/zabbixsrv for server and proxy.
+
+
+=Additional packaging changes in Fedora/EPEL since 1.8=
+
+==Zabbix 2.0 packages conflict Zabbix 1.8; 2.2 conflicts 1.8 and 2.0==
+
+This measure was taken because this major version introduces various database
+schema changes. A silent update would render Zabbix non-operational and possibly
+break the database. Besides that, Zabbix 2.0/2.2 server only works with the
+respective major versions of servers and proxies. Distributed setups must
+therefore be updated at the same time to keep working.
+
+http://www.zabbix.com/documentation/2.0/manual/appendix/compatibility
+http://www.zabbix.com/documentation/2.2/manual/appendix/compatibility
+
 --------------------------------------------------------------------------------
 
+=Guide for upgrading to 2.2 from 2.0=
+
+https://www.zabbix.com/documentation/2.2/manual/installation/upgrade
+https://www.zabbix.com/documentation/2.2/manual/installation/upgrade_notes_220
+
+Be sure to read the upgrades notes of the latest minor release too!
+
+- Review all rpmnew and rpmsave files; merge where necessary
+- Review permissions, ownerships and group memberships for zabbixsrv
+- Migrate server and proxy logs to the new location, if you want
+- Back up the Zabbix database (really!)
+- Remove custom database changes, if any
+- Make sure the database user has sufficing permissions
+  (ALTER TABLE, DROP INDEX, DROP TABLE, ...)
+- Start the server
+- Check the server log for progress and possible errors
+  The schema conversion should finish within minutes or hours
+
+
 =Guide for upgrading to 2.0 from 1.8=
 
-http://www.zabbix.com/documentation/2.0/manual/installation/upgrade==notes
+https://www.zabbix.com/documentation/2.0/manual/installation/upgrade_notes?s[]=upgrade&s[]=notes&s[]=2&s[]=0
+
+Be sure to read the upgrades notes of the latest minor release too!
 
 The below should be the relevant steps, picked from
 http://www.zabbix.com/documentation/2.0/manual/installation/upgrade
@@ -171,4 +225,4 @@ http://www.zabbix.com/documentation/2.0/manual/installation/upgrade
   your hardware;
 - Check the output of the script for errors
 
-Volker Fröhlich volker27 at gmx.at Jan  3 2013
+Volker Fröhlich volker27 at gmx.at Jan  5 2013
diff --git a/zabbix-logrotate.in b/zabbix-logrotate.in
index c2f9045..b8799ab 100644
--- a/zabbix-logrotate.in
+++ b/zabbix-logrotate.in
@@ -1,8 +1,8 @@
-/var/log/zabbix/zabbix_COMPONENT.log {
+/var/log/USER/zabbix_COMPONENT.log {
 	missingok
 	monthly
 	notifempty
 	compress
-	create 0664 zabbix zabbix
-	su zabbix zabbix
+	create 0664 USER USER
+	su USER USER
 }
diff --git a/zabbix-proxy-mysql.service b/zabbix-proxy-mysql.service
index 6464a5a..0d62f89 100644
--- a/zabbix-proxy-mysql.service
+++ b/zabbix-proxy-mysql.service
@@ -1,5 +1,5 @@
 [Unit]
-Description=Zabbix MySQL Proxy Agent
+Description=Zabbix MySQL Proxy
 After=syslog.target network.target mysqld.service
 
 [Service]
diff --git a/zabbix-proxy-pgsql.service b/zabbix-proxy-pgsql.service
index 5d52fd9..7979d35 100644
--- a/zabbix-proxy-pgsql.service
+++ b/zabbix-proxy-pgsql.service
@@ -1,5 +1,5 @@
 [Unit]
-Description=Zabbix PostgreSQL Proxy Agent
+Description=Zabbix PostgreSQL Proxy
 After=syslog.target network.target postgresql.service
 
 [Service]
diff --git a/zabbix-proxy-sqlite3.service b/zabbix-proxy-sqlite3.service
index a102fc0..da3349c 100644
--- a/zabbix-proxy-sqlite3.service
+++ b/zabbix-proxy-sqlite3.service
@@ -1,5 +1,5 @@
 [Unit]
-Description=Zabbix SQLite3 Proxy Agent
+Description=Zabbix SQLite3 Proxy
 After=syslog.target network.target
 
 [Service]
diff --git a/zabbix-tmpfiles-zabbix.conf b/zabbix-tmpfiles-zabbix.conf
new file mode 100644
index 0000000..0e4755a
--- /dev/null
+++ b/zabbix-tmpfiles-zabbix.conf
@@ -0,0 +1 @@
+D /var/run/zabbix 0755 zabbix zabbix -
diff --git a/zabbix-tmpfiles-zabbixsrv.conf b/zabbix-tmpfiles-zabbixsrv.conf
new file mode 100644
index 0000000..c06f6e5
--- /dev/null
+++ b/zabbix-tmpfiles-zabbixsrv.conf
@@ -0,0 +1 @@
+D /var/run/zabbixsrv 0755 zabbixsrv zabbixsrv -
diff --git a/zabbix.spec b/zabbix.spec
index 2c844d2..0c69986 100644
--- a/zabbix.spec
+++ b/zabbix.spec
@@ -1,4 +1,5 @@
 # TODO, maybe sometime:
+# * Allow for nginx?
 # * F18 systemd macros, when EL6 reaches EOL
 # * Do something about mutex errors sometimes occurring when init scripts'
 #   restart is invoked; something like "sleep 2" between stop and start?
@@ -10,16 +11,11 @@
 #TODO: systemctl reload seems to be necessary after switching with Alternatives
 #TODO: If the DB path for a Sqlite proxy is configured wrong, it requires systemctl restart. Start doesn't work.
 
-# Allow pinger lists in /var/lib/zabbixsrv/tmp
-#echo "avc:  denied  { read } for  pid=3427 comm="fping6" path="/var/lib/zabbixsrv/tmp/zabbix_server_pgsql_3002.pinger" dev=dm-1 ino=20 scontext=system_u:system_r:ping_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=file" | audit2allow -M myzab; sudo semodule -i myzab2.pp
-
-#type=AVC msg=audit(1346965425.718:65127): avc:  denied  { getattr } for  pid=3427 comm="fping6" path="/var/lib/zabbixsrv/tmp/zabbix_server_pgsql_3002.pinger" dev=dm-1 ino=20 scontext=system_u:system_r:ping_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=file
-
 %global srcname zabbix
 
 Name:           zabbix
-Version:        2.0.11
-Release:        2%{?dist}
+Version:        2.2.2
+Release:        1%{?dist}
 Summary:        Open-source monitoring solution for your IT infrastructure
 
 Group:          Applications/Internet
@@ -30,7 +26,7 @@ URL:            http://www.zabbix.com
 Source0:        %{srcname}-%{version}-free.tar.gz
 Source1:        %{srcname}-web.conf
 Source5:        %{srcname}-logrotate.in
-Source9:        %{srcname}-tmpfiles.conf
+Source9:        %{srcname}-tmpfiles-zabbix.conf
 # systemd units -- Alternatives switches between them (they state their dependencies)
 # https://support.zabbix.com/browse/ZBXNEXT-1593
 Source10:       %{srcname}-agent.service
@@ -39,11 +35,11 @@ Source12:       %{srcname}-proxy-pgsql.service
 Source13:       %{srcname}-proxy-sqlite3.service
 Source14:       %{srcname}-server-mysql.service
 Source15:       %{srcname}-server-pgsql.service
-
-Source16:       %{srcname}-fedora.README
+Source16:       %{srcname}-fedora-epel.README
+Source17:        %{srcname}-tmpfiles-zabbixsrv.conf
 
 # local rules for config files
-Patch0:         %{srcname}-2.0.2-config.patch
+Patch0:         %{srcname}-2.1.9-config.patch
 # local rules for config files - fonts
 Patch1:         %{srcname}-2.0.3-fonts-config.patch
 # remove flash content (#737337)
@@ -63,12 +59,16 @@ BuildRequires:   unixODBC-devel
 BuildRequires:   curl-devel
 BuildRequires:   OpenIPMI-devel
 BuildRequires:   libssh2-devel
+BuildRequires:   libxml2-devel
 BuildRequires:   systemd
 
 Requires:        logrotate
+Provides:        bundled(md5-deutsch)
 # Could alternatively be conditional on Fedora/EL
 %if %{srcname} != %{name}
-Conflicts:       %{srcname}
+Provides:        %{srcname} = %{version}-%{release}
+Conflicts:       %{srcname} < 2.2
+Conflicts:       %{srcname}20
 %else
 Obsoletes:       %{srcname}-docs < 1.8.15-2
 Obsoletes:       %{srcname}-web-sqlite3 < 2.0.3-3
@@ -91,6 +91,33 @@ play an important role in monitoring IT infrastructure. This is equally true
 for small organizations with a few servers and for large companies with a
 multitude of servers.
 
+%package dbfiles-mysql
+Summary:             Zabbix database schemas, images, data and patches
+Group:               Applications/Internet
+BuildArch:           noarch
+
+%description dbfiles-mysql
+Zabbix database schemas, images, data and patches necessary for creating
+and/or updating MySQL databases
+
+%package dbfiles-pgsql
+Summary:             Zabbix database schemas, images, data and patches
+Group:               Applications/Internet
+BuildArch:           noarch
+
+%description dbfiles-pgsql
+Zabbix database schemas, images, data and patches necessary for creating
+and/or updating PostgreSQL databases
+
+%package dbfiles-sqlite3
+Summary:             Zabbix database schemas and patches
+Group:               Applications/Internet
+BuildArch:           noarch
+
+%description dbfiles-sqlite3
+Zabbix database schemas and patches necessary for creating
+and/or updating SQLite databases
+
 %package server
 Summary:             Zabbix server common files
 Group:               Applications/Internet
@@ -110,6 +137,7 @@ Zabbix server common files
 Summary:             Zabbix server compiled to use MySQL
 Group:               Applications/Internet
 Requires:            %{name} = %{version}-%{release}
+Requires:            %{name}-dbfiles-mysql
 Requires:            %{name}-server = %{version}-%{release}
 Requires(post):      %{_sbindir}/update-alternatives
 Requires(preun):     %{_sbindir}/alternatives
@@ -120,17 +148,18 @@ Provides:            %{name}-server-implementation = %{version}-%{release}
 Zabbix server compiled to use MySQL
 
 %package server-pgsql
-Summary:             Zabbix server compiled to use PostgresSQL
+Summary:             Zabbix server compiled to use PostgreSQL
 Group:               Applications/Internet
 Requires:            %{name} = %{version}-%{release}
 Requires:            %{name}-server = %{version}-%{release}
+Requires:            %{name}-dbfiles-pgsql
 Requires(post):      %{_sbindir}/update-alternatives
 Requires(preun):     %{_sbindir}/alternatives
 Requires(postun):    %{_sbindir}/update-alternatives
 Provides:            %{name}-server-implementation = %{version}-%{release}
 
 %description server-pgsql
-Zabbix server compiled to use PostgresSQL
+Zabbix server compiled to use PostgreSQL
 
 %package agent
 Summary:             Zabbix Agent
@@ -162,6 +191,7 @@ The Zabbix proxy
 Summary:             Zabbix proxy compiled to use MySQL
 Group:               Applications/Internet
 Requires:            %{name}-proxy = %{version}-%{release}
+Requires:            %{name}-dbfiles-mysql
 Provides:            %{name}-proxy-implementation = %{version}-%{release}
 Requires(post):      %{_sbindir}/update-alternatives
 Requires(preun):     %{_sbindir}/alternatives
@@ -174,6 +204,7 @@ The Zabbix proxy compiled to use MySQL
 Summary:             Zabbix proxy compiled to use PostgreSQL
 Group:               Applications/Internet
 Requires:            %{name}-proxy = %{version}-%{release}
+Requires:            %{name}-dbfiles-pgsql
 Provides:            %{name}-proxy-implementation = %{version}-%{release}
 Requires(post):      %{_sbindir}/update-alternatives
 Requires(preun):     %{_sbindir}/alternatives
@@ -186,6 +217,7 @@ The Zabbix proxy compiled to use PostgreSQL
 Summary:             Zabbix proxy compiled to use SQLite
 Group:               Applications/Internet
 Requires:            %{name}-proxy = %{version}-%{release}
+Requires:            %{name}-dbfiles-sqlite3
 Provides:            %{name}-proxy-implementation = %{version}-%{release}
 Requires(post):      %{_sbindir}/update-alternatives
 Requires(preun):     %{_sbindir}/alternatives
@@ -250,9 +282,6 @@ rm -f frontends/php/images/flash/zbxclock.swf
 
 %patch3 -p1
 
-# Logrotate's su option is only available in Fedora and EL 7
-sed -i '/su zabbix zabbix/d' %{SOURCE5}
-
 # Remove bundled java libs
 rm -rf src/zabbix_java/lib/*.jar
 
@@ -290,8 +319,8 @@ sed -i \
 
 #TODO: It'd be better to leave the defaults in a commment and just override them, as they are still hard-coded!
 sed -i \
-    -e 's|# PidFile=.*|PidFile=%{_localstatedir}/run/zabbix/zabbix_server.pid|g' \
-    -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_server.log|g' \
+    -e 's|# PidFile=.*|PidFile=%{_localstatedir}/run/zabbixsrv/zabbix_server.pid|g' \
+    -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbixsrv/zabbix_server.log|g' \
     -e 's|# LogFileSize=.*|LogFileSize=0|g' \
     -e 's|# AlertScriptsPath=${datadir}/zabbix/|AlertScriptsPath=%{_sharedstatedir}/zabbixsrv/|g' \
     -e 's|^DBUser=root|DBUser=zabbix|g' \
@@ -303,8 +332,8 @@ sed -i \
 
 #TODO: It'd be better to leave the defaults in a commment and just override them, as they are still hard-coded!
 sed -i \
-    -e 's|# PidFile=.*|PidFile=%{_localstatedir}/run/zabbix/zabbix_proxy.pid|g' \
-    -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_proxy.log|g' \
+    -e 's|# PidFile=.*|PidFile=%{_localstatedir}/run/zabbixsrv/zabbix_proxy.pid|g' \
+    -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbixsrv/zabbix_proxy.log|g' \
     -e 's|# LogFileSize=.*|LogFileSize=0|g' \
     -e 's|^DBUser=root|DBUser=zabbix|g' \
     -e 's|# DBSocket=/tmp/mysql.sock|DBSocket=%{_sharedstatedir}/mysql/mysql.sock|g' \
@@ -321,7 +350,7 @@ sed -i 's|/usr/local||g' \
     upgrades/dbpatches/2.0/postgresql/patch.sql
 
 # Install README file
-install -m0644 %{SOURCE16} .
+install -m 0644 -p %{SOURCE16} .
 
 
 %build
@@ -339,6 +368,7 @@ common_flags="
     --with-jabber
     --with-unixodbc
     --with-ssh2
+    --with-libxml2
 "
 
 # Frontend doesn't work for SQLite, thus don't build server
@@ -368,7 +398,9 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/web
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/zabbix
+mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/zabbixsrv
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/zabbix
+mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/zabbixsrv
 mkdir -p $RPM_BUILD_ROOT%{_unitdir}
 
 # Frontend
@@ -398,11 +430,11 @@ mv $RPM_BUILD_ROOT%{_datadir}/%{srcname}/conf/maintenance.inc.php $RPM_BUILD_ROO
 install -m 0644 -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{srcname}.conf
 
 # Install log rotation
-sed -e 's|COMPONENT|agentd|g' %{SOURCE5} > \
+sed -e 's|COMPONENT|agentd|g; s|USER|zabbix|g' %{SOURCE5} > \
      $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-agent
-sed -e 's|COMPONENT|server|g' %{SOURCE5} > \
+sed -e 's|COMPONENT|server|g; s|USER|zabbixsrv|g' %{SOURCE5} > \
      $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-server
-sed -e 's|COMPONENT|proxy|g' %{SOURCE5} > \
+sed -e 's|COMPONENT|proxy|g; s|USER|zabbixsrv|g' %{SOURCE5} > \
      $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-proxy
 
 # Install different systemd units because of the requirements for DBMS daemons
@@ -433,7 +465,7 @@ mkdir $RPM_BUILD_ROOT%{_sharedstatedir}/zabbixsrv/tmp
 # Install sql files
 for db in postgresql mysql; do
     datadir=$RPM_BUILD_ROOT%{_datadir}/%{srcname}-$db
-    install -dm 755 $datadir/upgrades/{1.6,1.8,2.0}
+    install -dm 0755 $datadir/upgrades/{1.6,1.8,2.0}
     cp -p database/$db/* $datadir
     cp -pR upgrades/dbpatches/1.6/$db/* $datadir/upgrades/1.6
     cp -pR upgrades/dbpatches/1.8/$db/* $datadir/upgrades/1.8
@@ -445,7 +477,8 @@ cp -p database/sqlite3/schema.sql $RPM_BUILD_ROOT%{_datadir}/%{srcname}-sqlite3
 
 # systemd must create /var/run/%{srcname}
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
-install -m 0644 %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/zabbix.conf
+install -m 0644 -p %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/zabbix.conf
+install -m 0644 -p %{SOURCE17} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/zabbixsrv.conf
 
 
 %post server
@@ -509,20 +542,34 @@ getent passwd zabbix > /dev/null || \
 %systemd_post zabbix-agent.service
 
 %pre server
-getent group zabbix > /dev/null || groupadd -r zabbix
-getent passwd zabbixsrv > /dev/null || \
-    useradd -r -g zabbix -d %{_sharedstatedir}/zabbixsrv -s /sbin/nologin \
+getent group zabbixsrv > /dev/null || groupadd -r zabbixsrv
+# The zabbixsrv group is introduced by 2.2 packaging
+# The zabbixsrv user was a member of the zabbix group in 2.0
+if getent passwd zabbixsrv > /dev/null; then
+    if [[ $(id -gn zabbixsrv) == "zabbix" ]]; then
+        usermod -c "Zabbix Monitoring System -- Proxy or server" -g zabbixsrv zabbixsrv
+    fi
+else
+    useradd -r -g zabbixsrv -d %{_sharedstatedir}/zabbixsrv -s /sbin/nologin \
     -c "Zabbix Monitoring System -- Proxy or server" zabbixsrv
+fi
 :
 
 %preun server
   %systemd_preun zabbix-server.service
 
 %pre proxy
-getent group zabbix > /dev/null || groupadd -r zabbix
-getent passwd zabbixsrv > /dev/null || \
-    useradd -r -g zabbix -d %{_sharedstatedir}/zabbixsrv -s /sbin/nologin \
+getent group zabbixsrv > /dev/null || groupadd -r zabbixsrv
+# The zabbixsrv group is introduced by 2.2 packaging
+# The zabbixsrv user was a member of the zabbix group in 2.0
+if getent passwd zabbixsrv > /dev/null; then
+    if [[ $(id -gn zabbixsrv) == "zabbix" ]]; then
+        usermod -c "Zabbix Monitoring System -- Proxy or server" -g zabbixsrv zabbixsrv
+    fi
+else
+    useradd -r -g zabbixsrv -d %{_sharedstatedir}/zabbixsrv -s /sbin/nologin \
     -c "Zabbix Monitoring System -- Proxy or server" zabbixsrv
+fi
 :
 
 %preun proxy
@@ -567,7 +614,7 @@ fi
 
 
 %files
-%doc AUTHORS ChangeLog COPYING NEWS README %{srcname}-fedora.README
+%doc AUTHORS ChangeLog COPYING NEWS README zabbix-fedora-epel.README
 %dir %{_sysconfdir}/%{srcname}
 %config(noreplace) %{_sysconfdir}/zabbix_agentd.conf
 %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_agentd.conf
@@ -577,16 +624,32 @@ fi
 %{_mandir}/man1/zabbix_get.1*
 %{_mandir}/man1/zabbix_sender.1*
 
+%files dbfiles-mysql
+%doc COPYING
+%{_datadir}/%{srcname}-mysql/
+
+%files dbfiles-pgsql
+%doc COPYING
+%{_datadir}/%{srcname}-postgresql/
+
+%files dbfiles-sqlite3
+%doc COPYING
+%{_datadir}/%{srcname}-sqlite3/
+
 %files server
 %doc misc/snmptrap/zabbix_trap_receiver.pl
-%attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix
-%attr(0600,zabbixsrv,zabbix) %config(noreplace) %{_sysconfdir}/zabbix_server.conf
+%config(noreplace) %{_sysconfdir}/tmpfiles.d/zabbixsrv.conf
+%attr(0640,root,zabbixsrv) %config(noreplace) %{_sysconfdir}/zabbix_server.conf
+%attr(0775,root,zabbixsrv) %dir %{_localstatedir}/log/zabbixsrv
 %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_server.conf
 %config(noreplace) %{_sysconfdir}/%{srcname}/externalscripts
 %config(noreplace) %{_sysconfdir}/%{srcname}/alertscripts
 %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix-server
 %ghost %{_sbindir}/zabbix_server
-%attr(0755,zabbixsrv,zabbix) %{_sharedstatedir}/zabbixsrv
+%attr(0750,zabbixsrv,zabbixsrv) %dir %{_sharedstatedir}/zabbixsrv
+%attr(0750,zabbixsrv,zabbixsrv) %dir %{_sharedstatedir}/zabbixsrv/tmp
+%attr(0750,zabbixsrv,zabbixsrv) %dir %{_sharedstatedir}/zabbixsrv/alertscripts
+%attr(0750,zabbixsrv,zabbixsrv) %dir %{_sharedstatedir}/zabbixsrv/externalscripts
 %ghost %{_unitdir}/zabbix-server.service
 %{_mandir}/man8/zabbix_server.8*
 
@@ -602,13 +665,14 @@ fi
 
 %files agent
 %doc conf/zabbix_agentd/*.conf
+%config(noreplace) %{_sysconfdir}/tmpfiles.d/zabbix.conf
 %attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix
 %config(noreplace) %{_sysconfdir}/zabbix_agent.conf
 %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_agent.conf
 %config(noreplace) %{_sysconfdir}/zabbix_agentd.conf
 %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_agentd.conf
 %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix-agent
-%attr(0755,zabbix,zabbix) %dir %{_sharedstatedir}/zabbix
+%attr(750,zabbix,zabbix) %dir %{_sharedstatedir}/zabbix
 %{_unitdir}/zabbix-agent.service
 %{_sbindir}/zabbix_agent
 %{_sbindir}/zabbix_agentd
@@ -616,13 +680,17 @@ fi
 
 %files proxy
 %doc misc/snmptrap/zabbix_trap_receiver.pl
-%attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix
-%attr(0600,zabbixsrv,zabbix) %config(noreplace) %{_sysconfdir}/zabbix_proxy.conf
+%attr(0640,root,zabbixsrv) %config(noreplace) %{_sysconfdir}/zabbix_proxy.conf
+%config(noreplace) %{_sysconfdir}/tmpfiles.d/zabbixsrv.conf
+%attr(0775,root,zabbixsrv) %dir %{_localstatedir}/log/zabbixsrv
 %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_proxy.conf
 %config(noreplace) %{_sysconfdir}/%{srcname}/externalscripts
 %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix-proxy
 %ghost %{_sbindir}/zabbix_proxy
-%attr(0755,zabbixsrv,zabbix) %{_sharedstatedir}/zabbixsrv
+%attr(0750,zabbixsrv,zabbixsrv) %dir %{_sharedstatedir}/zabbixsrv
+%attr(0750,zabbixsrv,zabbixsrv) %dir %{_sharedstatedir}/zabbixsrv/tmp
+%attr(0750,zabbixsrv,zabbixsrv) %dir %{_sharedstatedir}/zabbixsrv/alertscripts
+%attr(0750,zabbixsrv,zabbixsrv) %dir %{_sharedstatedir}/zabbixsrv/externalscripts
 %ghost %{_unitdir}/zabbix-proxy.service
 %{_mandir}/man8/zabbix_proxy.8*
 
@@ -653,6 +721,24 @@ fi
 %files web-pgsql
 
 %changelog
+* Sun Feb 16 2014 Volker Fröhlich <volker27 at gmx.at> - 2.2.2-1
+- New major release
+- Preserve timestamp on all install commands
+- Provide bundled md5-deutsch
+- Add noarch sub-packages for DB files
+- Correct directory permissions
+- Correct Conflicts directives
+- Correct /var/lib/zabbixsrv owner and permissions
+- Use dir directive for home directories and their sub-directories
+- Update config patch
+- Provide "zabbix"
+- Add libxml2-devel as BR for VMware monitoring and --with-libxml2 flag
+- Move user zabbixsrv to his own group
+  - Split tmpfiles.d, thus solve BZ#982001 
+  - Split lock, log and run locations
+  - Adapt ownership and permissions
+- Update README
+
 * Sun Feb 16 2014 Volker Fröhlich <volker27 at gmx.at> - 2.0.11-2
 - Remove if clauses for Fedora/RHEL as they are obsolete in EL 7
 - Use systemd scriplet macros (BZ#850378)
@@ -681,7 +767,7 @@ fi
 - New upstream release
 - Drop obsolete patches ZBX-6804, ZBX-7091, ZBX-6922, ZBX-6992
 
-* Thu Oct  3 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.8-3
+* Mon Sep 23 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.8-3
 - Add SQL speed-up patch (ZBX-6804)
 - Add SQL injection vulnerability patch (ZBX-7091, CVE-2013-5743)
 - Add patch for failing XML host import (ZBX-6922)
@@ -706,40 +792,49 @@ fi
 * Tue May 07 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.6-2
 - Add patch for ZBX-6526
 - Solve permission problem with /var/run/zabbix in Fedora (BZ#904041)
+- Remove origin of directories BZ#867159, comment 14 and 16
 
 * Mon Apr 22 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.6-1
 - New upstream release
+- Drop ZBX-6290 and ZBX-6318 patches
+
+* Tue Mar 19 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.5-3
+- Include patch for ZBX-6318
+
+* Tue Feb 12 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.5-2
+- Include patch for ZBX-6290
 
 * Tue Feb 12 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.5-1
 - New upstream release
 - Drop now-included patches
+- Init file comments point to the actual configuration files now
+
+* Sat Feb  9 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.4-5
+- Dispensable version of COPYING is no more
+- Correct path to traceroute in DB dumps again
 
-* Tue Jan 22 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.4-5
+* Tue Jan 22 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.4-4
 - Remove zabbix_get plus manpage from the proxy files section
 - Solve conflict for externalscripts symlink between proxy and
   server package
 
-* Sun Jan 20 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.4-4
-- Remove origin of directories BZ#867159, comment 14 and 16
-
 * Thu Jan 17 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.4-3
 - Patch for CVE-2013-1364
 
 * Mon Jan 14 2013 Volker Fröhlich <volker27 at gmx.at> - 2.0.4-2
-- New upstream release
-- Synchronized spec file with zabbix20
 - Apply patch for ZBX-6101
+- Add su line to logrotate config file
+- Do not own /var/run/zabbix on Fedora, systemd manages it
 - Add forgotten chkconfig and service commands on agent preun script
-- Add SNMP source IP address patch
-- Apply fping 3 patch only for Fedora
 
-* Fri Nov 30 2012 Volker Fröhlich <volker27 at gmx.at> - 2.0.3-7
-- Correct and complete conditionals for /var/run/zabbix
-- su line only works in Fedora
+* Sat Dec  8 2012 Volker Fröhlich <volker27 at gmx.at> - 2.0.4-1
+- New upstream release
+
+* Fri Dec  7 2012 Volker Fröhlich <volker27 at gmx.at> - 2.0.3-7
+- Add SNMP source IP address patch
 
-* Fri Nov 30 2012 Orion Poplawski <orion at cora.nwra.com> - 2.0.3-6
-- Add su line to logrotate config file
-- Do not own /var/run/zabbix on Fedora, systemd manages it
+* Mon Nov 26 2012 Volker Fröhlich <volker27 at gmx.at> - 2.0.3-6
+- Apply fping 3 patch only for Fedora
 
 * Tue Nov 13 2012 Volker Fröhlich <volker27 at gmx.at> - 2.0.3-5
 - Adapt httpd configuration file for Apache 2.4 (BZ#871498)


More information about the scm-commits mailing list