From bad54d484274f3f2ebee81639f9ab70f4e0520e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Sun, 16 Feb 2014 15:33:22 +0100 Subject: [PATCH 01/12] Import latest el6 --- .gitignore | 1 + dead.package | 1 - sources | 1 + zabbix-1.8.12-fping3.patch | 39 ++ zabbix-2.0.1-no-flash.patch | 11 + zabbix-2.0.2-config.patch | 22 + zabbix-2.0.3-fonts-config.patch | 12 + zabbix-agent.init | 89 +++ zabbix-agent.service | 12 + zabbix-fedora.README | 174 +++++ zabbix-logrotate.in | 8 + zabbix-proxy-mysql.service | 12 + zabbix-proxy-pgsql.service | 12 + zabbix-proxy-sqlite3.service | 12 + zabbix-proxy.init | 87 +++ zabbix-server-mysql.service | 12 + zabbix-server-pgsql.service | 12 + zabbix-server.init | 87 +++ zabbix-tmpfiles.conf | 1 + zabbix-web.conf | 48 ++ zabbix20.spec | 1114 +++++++++++++++++++++++++++++++ 21 files changed, 1766 insertions(+), 1 deletion(-) create mode 100644 .gitignore delete mode 100644 dead.package create mode 100644 sources create mode 100644 zabbix-1.8.12-fping3.patch create mode 100644 zabbix-2.0.1-no-flash.patch create mode 100644 zabbix-2.0.2-config.patch create mode 100644 zabbix-2.0.3-fonts-config.patch create mode 100644 zabbix-agent.init create mode 100644 zabbix-agent.service create mode 100644 zabbix-fedora.README create mode 100644 zabbix-logrotate.in create mode 100644 zabbix-proxy-mysql.service create mode 100644 zabbix-proxy-pgsql.service create mode 100644 zabbix-proxy-sqlite3.service create mode 100644 zabbix-proxy.init create mode 100644 zabbix-server-mysql.service create mode 100644 zabbix-server-pgsql.service create mode 100644 zabbix-server.init create mode 100644 zabbix-tmpfiles.conf create mode 100644 zabbix-web.conf create mode 100644 zabbix20.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e9dd2a6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/zabbix-2.0.11-free.tar.gz diff --git a/dead.package b/dead.package deleted file mode 100644 index 842eb46..0000000 --- a/dead.package +++ /dev/null @@ -1 +0,0 @@ -an EPEL-only package must be dead.package in master diff --git a/sources b/sources new file mode 100644 index 0000000..9ab4c4c --- /dev/null +++ b/sources @@ -0,0 +1 @@ +71dbe3737daf554daacb90933d611a07 zabbix-2.0.11-free.tar.gz diff --git a/zabbix-1.8.12-fping3.patch b/zabbix-1.8.12-fping3.patch new file mode 100644 index 0000000..db8c456 --- /dev/null +++ b/zabbix-1.8.12-fping3.patch @@ -0,0 +1,39 @@ +diff -up zabbix-1.8.12/src/libs/zbxicmpping/icmpping.c.fping3 zabbix-1.8.12/src/libs/zbxicmpping/icmpping.c +--- zabbix-1.8.12/src/libs/zbxicmpping/icmpping.c.fping3 2012-04-24 16:31:36.000000000 +0200 ++++ zabbix-1.8.12/src/libs/zbxicmpping/icmpping.c 2012-04-24 16:32:31.000000000 +0200 +@@ -42,34 +42,7 @@ static const char *source_ip6_option = N + + static void get_source_ip_option(const char *fping, const char **option, unsigned char *checked) + { +- FILE *f; +- char *p, tmp[MAX_STRING_LEN]; +- +- zbx_snprintf(tmp, sizeof(tmp), "%s -h 2>&1", fping); +- +- if (NULL == (f = popen(tmp, "r"))) +- return; +- +- while (NULL != fgets(tmp, sizeof(tmp), f)) +- { +- for (p = tmp; isspace(*p); p++) +- ; +- +- if ('-' == p[0] && 'I' == p[1] && isspace(p[2])) +- { +- *option = "-I"; +- break; +- } +- +- if ('-' == p[0] && 'S' == p[1] && isspace(p[2])) +- { +- *option = "-S"; +- break; +- } +- } +- +- pclose(f); +- ++ *option = "-S"; + *checked = 1; + } + diff --git a/zabbix-2.0.1-no-flash.patch b/zabbix-2.0.1-no-flash.patch new file mode 100644 index 0000000..36a7824 --- /dev/null +++ b/zabbix-2.0.1-no-flash.patch @@ -0,0 +1,11 @@ +diff -up zabbix-2.0.1/frontends/php/include/screens.inc.php.orig zabbix-2.0.1/frontends/php/include/screens.inc.php +--- zabbix-2.0.1/frontends/php/include/screens.inc.php.orig 2012-06-27 23:03:03.000000000 +0200 ++++ zabbix-2.0.1/frontends/php/include/screens.inc.php 2012-07-12 16:29:02.000000000 +0200 +@@ -25,7 +25,6 @@ require_once dirname(__FILE__).'/js.inc. + + function screen_resources($resource = null) { + $resources = array( +- SCREEN_RESOURCE_CLOCK => _('Clock'), + SCREEN_RESOURCE_DATA_OVERVIEW => _('Data overview'), + SCREEN_RESOURCE_GRAPH => _('Graph'), + SCREEN_RESOURCE_ACTIONS => _('History of actions'), diff --git a/zabbix-2.0.2-config.patch b/zabbix-2.0.2-config.patch new file mode 100644 index 0000000..c25238b --- /dev/null +++ b/zabbix-2.0.2-config.patch @@ -0,0 +1,22 @@ +diff -Nur zabbix-2.0.2/frontends/php/include/config.inc.php zabbix-2.0.2-conf/frontends/php/include/config.inc.php +--- zabbix-2.0.2/frontends/php/include/config.inc.php 2012-07-31 11:16:47.000000000 +0200 ++++ zabbix-2.0.2-conf/frontends/php/include/config.inc.php 2012-09-04 00:07:03.217816413 +0200 +@@ -31,7 +31,7 @@ + CProfiler::getInstance()->start(); + + require_once dirname(__FILE__).'/profiles.inc.php'; +-require_once dirname(__FILE__).'/../conf/maintenance.inc.php'; ++require_once '/etc/zabbix/web/maintenance.inc.php'; + + // abc sorting + require_once dirname(__FILE__).'/acknow.inc.php'; +@@ -64,8 +64,7 @@ + $USER_RIGHTS = array(); + $ZBX_LOCALNODEID = 0; + $ZBX_LOCMASTERID = 0; +-$ZBX_CONFIGURATION_FILE = './conf/zabbix.conf.php'; +-$ZBX_CONFIGURATION_FILE = realpath(dirname($ZBX_CONFIGURATION_FILE)).DIRECTORY_SEPARATOR.basename($ZBX_CONFIGURATION_FILE); ++$ZBX_CONFIGURATION_FILE = '/etc/zabbix/web/zabbix.conf.php'; + + // include tactical overview modules + require_once dirname(__FILE__).'/locales.inc.php'; diff --git a/zabbix-2.0.3-fonts-config.patch b/zabbix-2.0.3-fonts-config.patch new file mode 100644 index 0000000..02dd5e5 --- /dev/null +++ b/zabbix-2.0.3-fonts-config.patch @@ -0,0 +1,12 @@ +diff -Nur zabbix-2.0.3/frontends/php/include/defines.inc.php zabbix-2.0.3-fonts/frontends/php/include/defines.inc.php +--- zabbix-2.0.3/frontends/php/include/defines.inc.php 2012-10-03 16:41:36.000000000 +0200 ++++ zabbix-2.0.3-fonts/frontends/php/include/defines.inc.php 2012-10-05 23:47:17.341790748 +0200 +@@ -34,7 +34,7 @@ + + define('ZBX_WIDGET_ROWS', 20); + +-define('ZBX_FONTPATH', realpath('fonts')); // where to search for font (GD > 2.0.18) ++define('ZBX_FONTPATH', '/usr/share/fonts/dejavu'); // where to search for font (GD > 2.0.18) + define('ZBX_GRAPH_FONT_NAME', 'DejaVuSans'); // font file name + define('ZBX_GRAPH_LEGEND_HEIGHT', 120); // when graph height is less then this value, some legend will not show up + diff --git a/zabbix-agent.init b/zabbix-agent.init new file mode 100644 index 0000000..cb97acf --- /dev/null +++ b/zabbix-agent.init @@ -0,0 +1,89 @@ +#!/bin/sh +# +# chkconfig: - 86 14 +# description: Zabbix agent daemon +# + +### BEGIN INIT INFO +# Provides: zabbix-agent +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Should-Start: zabbix-server zabbix-proxy +# Should-Stop: zabbix-server zabbix-proxy +# Default-Start: +# Default-Stop: 0 1 2 3 4 5 6 +# Short-Description: Start and stop Zabbix agent +# Description: Zabbix agent daemon +### END INIT INFO + +# Source function library. +. /etc/rc.d/init.d/functions + +exec=/usr/sbin/zabbix_agentd +prog=${exec##*/} +syscf=${0##*/} +lockfile=/var/lock/subsys/$syscf + +[ -f /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf + +config=${CFG_FILE:-/etc/zabbix_agentd.conf} +if [ ! -f $config ]; then + echo "Not starting Zabbix agent: Config file $config not found!" + echo "Check /etc/sysconfig/$syscf" + exit 3 +fi + +pidfile=$(grep -e "^PidFile=.*$" $config | cut -d= -f2) +param="-c $config" + +start() +{ + echo -n $"Starting Zabbix agent: " + daemon --user zabbix --pidfile "$pidfile" $exec $param + rv=$? + echo + [ $rv -eq 0 ] && touch $lockfile + return $rv +} + +stop() +{ + echo -n $"Shutting down Zabbix agent: " + killproc -p "$pidfile" $prog + rv=$? + echo + [ $rv -eq 0 ] && rm -f $lockfile + return $rv +} + +restart() +{ + stop + start +} + +case "$1" in + start|stop|restart) + $1 + ;; + force-reload) + restart + ;; + status) + status -p "$pidfile" -l $prog $exec + ;; + try-restart|condrestart) + if status -p "$pidfile" -l $prog $exec >/dev/null ; then + restart + fi + ;; + reload) + action $"Service ${0##*/} does not support the reload action: " /bin/false + exit 3 + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" + exit 2 + ;; +esac + diff --git a/zabbix-agent.service b/zabbix-agent.service new file mode 100644 index 0000000..27bfad7 --- /dev/null +++ b/zabbix-agent.service @@ -0,0 +1,12 @@ +[Unit] +Description=Zabbix Monitor Agent +After=syslog.target network.target + +[Service] +Type=oneshot +ExecStart=/usr/sbin/zabbix_agentd +RemainAfterExit=yes +User=zabbix + +[Install] +WantedBy=multi-user.target diff --git a/zabbix-fedora.README b/zabbix-fedora.README new file mode 100644 index 0000000..3a6f35e --- /dev/null +++ b/zabbix-fedora.README @@ -0,0 +1,174 @@ +=Custom in Fedora/EPEL= + +==Pinger files== + +Since /tmp is not a good place to spool files, the pinger files shall now reside +in /var/lib/zabbixsrv/tmp. This directory is automatically created and proxy and +server configuration files are changed accordingly from 2.0.8 on. + + +==Web configuration== + +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. + + +==Where's my Flash watch?== + +It's not included in Fedora! Fedora's policy does not allow to include blobs: +https://support.zabbix.com/browse/ZBX-4794 + + +==No htaccess files== + +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== + +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 +for proxy and server. Please check the permissions of your scripts and group +memberships, if necessary. + + +==Using the Alternatives system instead of conflicting sub-packages== + +You can now install Zabbix proxies or servers compiled for different database +back-ends on the same system. While this is not intended to happily switch back +and forth, it allows you to: + +- Stop the daemon +- "Run alternatives --config zabbix-server" or + "alternatives --config zabbix-proxy" +- Make your choice +- If you're using systemd, run systemctl reload +- Adjust the configuration file +- Start the daemon +- In some cases you have to use "restart" instead of "start". + The reason is not yet clear to me. + +"Alternatives" considers the first installed implementation of server or proxy as +default, respectively. + +Don't forget to reconfigure the front-end when you switch the server to a +different DB implementation! + + +==How to run multiple instances of a Zabbix daemon with init scripts== + +If you want to run multiple instances on the same host, do the following: + +- Copy the init scripts +- Create a file of the same name as the new init script in /etc/sysconfig +- Define CFG_FILE="" in this file +- Create the file defined as CFG_FILE and adjust settings; in particular: + - DB settings if you set up multiple instances of server and proxy daemons; + IMPORTANT: Two daemons using the same database at the same time could act + destructive! + - PidFile + - ListenPort and/or ListenIP, if you plan for simultaneous operation; + Don't forget to review your firewall settings! + - LogFile, if you don't use syslog +- Optionally run the following to register the new instance as a service and + start it up automatically: + chkconfig --add + chkconfig on +- service start + + +==Configuration changes== + +Zabbix 2.0 places configuration files directly in /etc. Symlinks preserve +compatibility. maintenance.inc.php moved from /usr/share/zabbix/conf to +/etc/zabbix/web. + + +==Media scripts and external scripts== + +The directories for external scripts and media scripts have moved to +/var/lib/zabbixsrv. Symlinks preserve compatibility. + +/var/lib/zabbix is now intended for scripts run by the agent. Please move your +server or proxy scripts to /var/lib/zabbixsrv. Be sure to check permissions and +ownership. + + +==No Java bridge== + +The Zabbix Java bridge can not be included now, due to legal issue with one of +the modules (json). See https://support.zabbix.com/browse/ZBX-4800 and feel free +to vote on it. + + +==No SQLite front-end or server implementation== + +Sadly it doesn't work with how Fedora's/EPEL's PHP is compiled. + +-------------------------------------------------------------------------------- + +=SELinux= + +The settings necessary for you vary, depending on how you set up your system/s. +Most of the time, the only adjustments necessary should be on the machine that +holds the frontend: + +#Allow to connect the frontend to a database by other means than sockets +setsebool -P httpd_can_network_connect_db 1 + +#Allow the frontend to create a connection to the server listening port +#That's the check the frontend uses to see whether the server is running. +#This option effectively supersedes the previous +setsebool -P httpd_can_network_connect 1 + +Using sebools is a somewhat coarse method of allowing things. +A more fine-grained approach for the latter would be to grab an actual +avc denial from the audit log, pipe it through audit2allow, put it in a +module package and load that: + +echo "avc: denied { name_connect } for pid=20619 comm="httpd" dest=10051 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:zabbix_port_t:s0 tclass=tcp_socket" | audit2allow -M zabbix_conn_httpd; sudo semodule -i zabbix_conn_httpd.pp + +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 + +-------------------------------------------------------------------------------- + +=Guide for upgrading to 2.0 from 1.8= + +http://www.zabbix.com/documentation/2.0/manual/installation/upgrade==notes + +The below should be the relevant steps, picked from +http://www.zabbix.com/documentation/2.0/manual/installation/upgrade + +- Review all rpmnew and rpmsave files; merge where necessary +- Review permissions, ownerships and group memberships for zabbixsrv +- 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, ...) +- Run the fitting database update script/s +- The scripts can run very long, depending on the content of your database and + your hardware; +- Check the output of the script for errors + +Volker Fröhlich volker27@gmx.at Jan 3 2013 diff --git a/zabbix-logrotate.in b/zabbix-logrotate.in new file mode 100644 index 0000000..c2f9045 --- /dev/null +++ b/zabbix-logrotate.in @@ -0,0 +1,8 @@ +/var/log/zabbix/zabbix_COMPONENT.log { + missingok + monthly + notifempty + compress + create 0664 zabbix zabbix + su zabbix zabbix +} diff --git a/zabbix-proxy-mysql.service b/zabbix-proxy-mysql.service new file mode 100644 index 0000000..6464a5a --- /dev/null +++ b/zabbix-proxy-mysql.service @@ -0,0 +1,12 @@ +[Unit] +Description=Zabbix MySQL Proxy Agent +After=syslog.target network.target mysqld.service + +[Service] +Type=oneshot +ExecStart=/usr/sbin/zabbix_proxy +RemainAfterExit=yes +User=zabbixsrv + +[Install] +WantedBy=multi-user.target diff --git a/zabbix-proxy-pgsql.service b/zabbix-proxy-pgsql.service new file mode 100644 index 0000000..5d52fd9 --- /dev/null +++ b/zabbix-proxy-pgsql.service @@ -0,0 +1,12 @@ +[Unit] +Description=Zabbix PostgreSQL Proxy Agent +After=syslog.target network.target postgresql.service + +[Service] +Type=oneshot +ExecStart=/usr/sbin/zabbix_proxy +RemainAfterExit=yes +User=zabbixsrv + +[Install] +WantedBy=multi-user.target diff --git a/zabbix-proxy-sqlite3.service b/zabbix-proxy-sqlite3.service new file mode 100644 index 0000000..a102fc0 --- /dev/null +++ b/zabbix-proxy-sqlite3.service @@ -0,0 +1,12 @@ +[Unit] +Description=Zabbix SQLite3 Proxy Agent +After=syslog.target network.target + +[Service] +Type=oneshot +ExecStart=/usr/sbin/zabbix_proxy +RemainAfterExit=yes +User=zabbixsrv + +[Install] +WantedBy=multi-user.target diff --git a/zabbix-proxy.init b/zabbix-proxy.init new file mode 100644 index 0000000..e3b2283 --- /dev/null +++ b/zabbix-proxy.init @@ -0,0 +1,87 @@ +#!/bin/sh +# +# chkconfig: - 85 15 +# description: Zabbix proxy daemon +# + +### BEGIN INIT INFO +# Provides: zabbix-proxy +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Default-Start: +# Default-Stop: 0 1 2 3 4 5 6 +# Short-Description: Start and stop Zabbix proxy +# Description: Zabbix proxy daemon +### END INIT INFO + +# Source function library. +. /etc/rc.d/init.d/functions + +exec=/usr/sbin/zabbix_proxy +prog=${exec##*/} +syscf=${0##*/} +lockfile=/var/lock/subsys/$syscf + +[ -f /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf + +config=${CFG_FILE:-/etc/zabbix_proxy.conf} +if [ ! -f $config ]; then + echo "Not starting Zabbix proxy: Config file $config not found!" + echo "Check /etc/sysconfig/$syscf" + exit 3 +fi + +pidfile=$(grep -e "^PidFile=.*$" $config | cut -d= -f2) +param="-c $config" + +start() +{ + echo -n $"Starting Zabbix proxy: " + daemon --user zabbixsrv --pidfile "$pidfile" $exec $param + rv=$? + echo + [ $rv -eq 0 ] && touch $lockfile + return $rv +} + +stop() +{ + echo -n $"Shutting down Zabbix proxy: " + killproc -p "$pidfile" $prog + rv=$? + echo + [ $rv -eq 0 ] && rm -f $lockfile + return $rv +} + +restart() +{ + stop + start +} + +case "$1" in + start|stop|restart) + $1 + ;; + force-reload) + restart + ;; + status) + status -p "$pidfile" -l $prog $exec + ;; + try-restart|condrestart) + if status -p "$pidfile" -l $prog $exec >/dev/null ; then + restart + fi + ;; + reload) + action $"Service ${0##*/} does not support the reload action: " /bin/false + exit 3 + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" + exit 2 + ;; +esac + diff --git a/zabbix-server-mysql.service b/zabbix-server-mysql.service new file mode 100644 index 0000000..9c0217b --- /dev/null +++ b/zabbix-server-mysql.service @@ -0,0 +1,12 @@ +[Unit] +Description=Zabbix Server with MySQL DB +After=syslog.target network.target mysqld.service + +[Service] +Type=oneshot +ExecStart=/usr/sbin/zabbix_server +RemainAfterExit=yes +User=zabbixsrv + +[Install] +WantedBy=multi-user.target diff --git a/zabbix-server-pgsql.service b/zabbix-server-pgsql.service new file mode 100644 index 0000000..a196b4c --- /dev/null +++ b/zabbix-server-pgsql.service @@ -0,0 +1,12 @@ +[Unit] +Description=Zabbix Server with PostgreSQL DB +After=syslog.target network.target postgresql.service + +[Service] +Type=oneshot +ExecStart=/usr/sbin/zabbix_server +RemainAfterExit=yes +User=zabbixsrv + +[Install] +WantedBy=multi-user.target diff --git a/zabbix-server.init b/zabbix-server.init new file mode 100644 index 0000000..0dd2710 --- /dev/null +++ b/zabbix-server.init @@ -0,0 +1,87 @@ +#!/bin/sh +# +# chkconfig: - 85 15 +# description: Zabbix server daemon +# + +### BEGIN INIT INFO +# Provides: zabbix-server +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Default-Start: +# Default-Stop: 0 1 2 3 4 5 6 +# Short-Description: Start and stop Zabbix server +# Description: Zabbix server daemon +### END INIT INFO + +# Source function library. +. /etc/rc.d/init.d/functions + +exec=/usr/sbin/zabbix_server +prog=${exec##*/} +syscf=${0##*/} +lockfile=/var/lock/subsys/$syscf + +[ -f /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf + +config=${CFG_FILE:-/etc/zabbix_server.conf} +if [ ! -f $config ]; then + echo "Not starting Zabbix server: Config file $config not found!" + echo "Check /etc/sysconfig/$syscf" + exit 3 +fi + +pidfile=$(grep -e "^PidFile=.*$" $config | cut -d= -f2) +param="-c $config" + +start() +{ + echo -n $"Starting Zabbix server: " + daemon --user zabbixsrv --pidfile "$pidfile" $exec $param + rv=$? + echo + [ $rv -eq 0 ] && touch $lockfile + return $rv +} + +stop() +{ + echo -n $"Shutting down Zabbix server: " + killproc -p "$pidfile" $prog + rv=$? + echo + [ $rv -eq 0 ] && rm -f $lockfile + return $rv +} + +restart() +{ + stop + start +} + +case "$1" in + start|stop|restart) + $1 + ;; + force-reload) + restart + ;; + status) + status -p "$pidfile" -l $prog $exec + ;; + try-restart|condrestart) + if status -p "$pidfile" -l $prog $exec >/dev/null ; then + restart + fi + ;; + reload) + action $"Service ${0##*/} does not support the reload action: " /bin/false + exit 3 + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" + exit 2 + ;; +esac + diff --git a/zabbix-tmpfiles.conf b/zabbix-tmpfiles.conf new file mode 100644 index 0000000..3099a5d --- /dev/null +++ b/zabbix-tmpfiles.conf @@ -0,0 +1 @@ +D /var/run/zabbix 0775 zabbix zabbix - diff --git a/zabbix-web.conf b/zabbix-web.conf new file mode 100644 index 0000000..4e4e237 --- /dev/null +++ b/zabbix-web.conf @@ -0,0 +1,48 @@ +# +# Zabbix monitoring system php web frontend +# + +Alias /zabbix /usr/share/zabbix + + + Options FollowSymLinks + AllowOverride None + + + # Apache 2.4 + Require all granted + + + + # Apache 2.2 + Order allow,deny + Allow from all + + + + + + + # Apache 2.4 + Require all denied + + + + # Apache 2.2 + Order deny,allow + Deny from all + + + + + # Apache 2.4 + Require all denied + + + + Order deny,allow + Deny from all + + + + diff --git a/zabbix20.spec b/zabbix20.spec new file mode 100644 index 0000000..2718d4c --- /dev/null +++ b/zabbix20.spec @@ -0,0 +1,1114 @@ +# TODO, maybe sometime: +# * 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? +# "Include" statement in config files needs patching in order to not load +# various backup files (*.rpm{orig,new,save}, *~ etc) in that dir. +# https://support.zabbix.com/browse/ZBXNEXT-497 +# * Consider using systemd's ReadWriteDirectories + +#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: zabbix20 +Version: 2.0.11 +Release: 1%{?dist} +Summary: Open-source monitoring solution for your IT infrastructure + +Group: Applications/Internet +License: GPLv2+ +URL: http://www.zabbix.com +#Source0: http://downloads.sourceforge.net/%{srcname}/%{srcname}-%{version}.tar.gz +# upstream tarball minus src/zabbix_java/lib/org-json-2010-12-28.jar +Source0: %{srcname}-%{version}-free.tar.gz +Source1: %{srcname}-web.conf +Source2: %{srcname}-server.init +Source3: %{srcname}-agent.init +Source4: %{srcname}-proxy.init +Source5: %{srcname}-logrotate.in +Source9: %{srcname}-tmpfiles.conf +# systemd units -- Alternatives switches between them (they state their dependencies) +# https://support.zabbix.com/browse/ZBXNEXT-1593 +Source10: %{srcname}-agent.service +Source11: %{srcname}-proxy-mysql.service +Source12: %{srcname}-proxy-pgsql.service +Source13: %{srcname}-proxy-sqlite3.service +Source14: %{srcname}-server-mysql.service +Source15: %{srcname}-server-pgsql.service + +Source16: %{srcname}-fedora.README + +# local rules for config files +Patch0: %{srcname}-2.0.2-config.patch +# local rules for config files - fonts +Patch1: %{srcname}-2.0.3-fonts-config.patch +# remove flash content (#737337) +# https://support.zabbix.com/browse/ZBX-4794 +Patch2: %{srcname}-2.0.1-no-flash.patch +# adapt for fping3 - https://support.zabbix.com/browse/ZBX-4894 +Patch3: %{srcname}-1.8.12-fping3.patch + +BuildRequires: mysql-devel +BuildRequires: postgresql-devel +BuildRequires: sqlite-devel +BuildRequires: net-snmp-devel +BuildRequires: openldap-devel +BuildRequires: gnutls-devel +BuildRequires: iksemel-devel +BuildRequires: unixODBC-devel +BuildRequires: curl-devel +BuildRequires: OpenIPMI-devel +BuildRequires: libssh2-devel +%if 0%{?fedora} +BuildRequires: systemd-units +%endif + +Requires: logrotate +# Could alternatively be conditional on Fedora/EL +%if %{srcname} != %{name} +Conflicts: %{srcname} +%else +Obsoletes: %{srcname}-docs < 1.8.15-2 +Obsoletes: %{srcname}-web-sqlite3 < 2.0.3-3 +Obsoletes: %{srcname}-server-sqlite3 < 2.0.3-3 +%endif + +%description +Zabbix is software that monitors numerous parameters of a network and the +health and integrity of servers. Zabbix uses a flexible notification mechanism +that allows users to configure e-mail based alerts for virtually any event. +This allows a fast reaction to server problems. Zabbix offers excellent +reporting and data visualization features based on the stored data. +This makes Zabbix ideal for capacity planning. + +Zabbix supports both polling and trapping. All Zabbix reports and statistics, +as well as configuration parameters are accessed through a web-based front end. +A web-based front end ensures that the status of your network and the health of +your servers can be assessed from any location. Properly configured, Zabbix can +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 server +Summary: Zabbix server common files +Group: Applications/Internet +Requires: %{name} = %{version}-%{release} +Requires: %{name}-server-implementation = %{version}-%{release} +Requires: fping +Requires: traceroute +Requires(pre): shadow-utils +%if 0%{?fedora} +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%else +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(postun): /sbin/service +%endif + +%description server +Zabbix server common files + +%package server-mysql +Summary: Zabbix server compiled to use MySQL +Group: Applications/Internet +Requires: %{name} = %{version}-%{release} +Requires: %{name}-server = %{version}-%{release} +Requires(post): %{_sbindir}/update-alternatives +Requires(preun): %{_sbindir}/alternatives +Requires(postun): %{_sbindir}/update-alternatives +Provides: %{name}-server-implementation = %{version}-%{release} + +%description server-mysql +Zabbix server compiled to use MySQL + +%package server-pgsql +Summary: Zabbix server compiled to use PostgresSQL +Group: Applications/Internet +Requires: %{name} = %{version}-%{release} +Requires: %{name}-server = %{version}-%{release} +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 + +%package agent +Summary: Zabbix Agent +Group: Applications/Internet +Requires: %{name} = %{version}-%{release} +Requires(pre): shadow-utils +%if 0%{?fedora} +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%else +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(postun): /sbin/service +%endif + +%description agent +The Zabbix client agent, to be installed on monitored systems. + +%package proxy +Summary: Zabbix Proxy +Group: Applications/Internet +Requires: %{name} = %{version}-%{release} +Requires: %{name}-proxy-implementation = %{version}-%{release} +Requires(pre): shadow-utils +%if 0%{?fedora} +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%else +Requires(post): /sbin/chkconfig +Requires(preun): /sbin/chkconfig +Requires(preun): /sbin/service +Requires(postun): /sbin/service +%endif +Requires: fping + +%description proxy +The Zabbix proxy + +%package proxy-mysql +Summary: Zabbix proxy compiled to use MySQL +Group: Applications/Internet +Requires: %{name}-proxy = %{version}-%{release} +Provides: %{name}-proxy-implementation = %{version}-%{release} +Requires(post): %{_sbindir}/update-alternatives +Requires(preun): %{_sbindir}/alternatives +Requires(postun): %{_sbindir}/update-alternatives + +%description proxy-mysql +The Zabbix proxy compiled to use MySQL + +%package proxy-pgsql +Summary: Zabbix proxy compiled to use PostgreSQL +Group: Applications/Internet +Requires: %{name}-proxy = %{version}-%{release} +Provides: %{name}-proxy-implementation = %{version}-%{release} +Requires(post): %{_sbindir}/update-alternatives +Requires(preun): %{_sbindir}/alternatives +Requires(postun): %{_sbindir}/update-alternatives + +%description proxy-pgsql +The Zabbix proxy compiled to use PostgreSQL + +%package proxy-sqlite3 +Summary: Zabbix proxy compiled to use SQLite +Group: Applications/Internet +Requires: %{name}-proxy = %{version}-%{release} +Provides: %{name}-proxy-implementation = %{version}-%{release} +Requires(post): %{_sbindir}/update-alternatives +Requires(preun): %{_sbindir}/alternatives +Requires(postun): %{_sbindir}/update-alternatives + +%description proxy-sqlite3 +The Zabbix proxy compiled to use SQLite + +%package web +Summary: Zabbix Web Frontend +Group: Applications/Internet +BuildArch: noarch +# Don't remove "php". Everything else only depends on php-common +# and you'll end up with no module for Apache! +Requires: php +Requires: php-gd +Requires: php-bcmath +Requires: php-ldap +Requires: php-mbstring +Requires: php-xml +Requires: php-gettext +Requires: dejavu-sans-fonts +Requires: %{name} = %{version}-%{release} +Requires: %{name}-web-database = %{version}-%{release} + +%description web +The php frontend to display the Zabbix web interface. + +%package web-mysql +Summary: Zabbix web frontend for MySQL +Group: Applications/Internet +BuildArch: noarch +Requires: %{name}-web = %{version}-%{release} +Requires: php-mysql +Provides: %{name}-web-database = %{version}-%{release} +Obsoletes: %{name}-web <= 1.5.3-0.1 + +%description web-mysql +Zabbix web frontend for MySQL + +%package web-pgsql +Summary: Zabbix web frontend for PostgreSQL +Group: Applications/Internet +BuildArch: noarch +Requires: %{name}-web = %{version}-%{release} +Requires: php-pgsql +Provides: %{name}-web-database = %{version}-%{release} + +%description web-pgsql +Zabbix web frontend for PostgreSQL + + +%prep +%setup0 -q -n %{srcname}-%{version} +%patch0 -p1 +%patch1 -p1 +%if 0%{?fedora} +%patch3 -p1 +%endif + +# Logrotate's su option is currently only available in Fedora +%if 0%{?rhel} +sed -i '/su zabbix zabbix/d' %{SOURCE5} +%endif + +# Remove flash applet +# https://support.zabbix.com/browse/ZBX-4794 +%patch2 -p1 +rm -f frontends/php/images/flash/zbxclock.swf + +# Remove bundled java libs +rm -rf src/zabbix_java/lib/*.jar + +# Remove prebuilt Windows binaries +rm -rf bin + +# Remove included fonts +rm -rf frontends/php/fonts + +# Remove executable permissions +chmod a-x upgrades/dbpatches/*/mysql/upgrade + +# Override statically named directory for alertscripts and externalscripts +# https://support.zabbix.com/browse/ZBX-6159 +sed -i 's|$(DESTDIR)@datadir@/zabbix|$(DESTDIR)/var/lib/zabbixsrv|' \ + src/zabbix_server/Makefile.in \ + src/zabbix_proxy/Makefile.in + +# Kill off .htaccess files, options set in SOURCE1 +rm -f frontends/php/include/.htaccess +rm -f frontends/php/api/.htaccess +rm -f frontends/php/conf/.htaccess + +# Fix path to traceroute utility +# Still valid for EL7! +find database -name 'data.sql' -exec sed -i 's|/usr/bin/traceroute|/bin/traceroute|' {} \; + +# Adapt configuration file options +sed -i \ + -e 's|# PidFile=.*|PidFile=%{_localstatedir}/run/zabbix/zabbix_agentd.pid|g' \ + -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_agentd.log|g' \ + -e 's|# LogFileSize=.*|LogFileSize=0|g' \ + -e 's|/usr/local||g' \ + conf/zabbix_agentd.conf + +sed -i \ + -e 's|/usr/local||g' \ + conf/zabbix_agent.conf + +#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|# LogFileSize=.*|LogFileSize=0|g' \ + -e 's|# AlertScriptsPath=${datadir}/zabbix/|AlertScriptsPath=%{_sharedstatedir}/zabbixsrv/|g' \ + -e 's|^DBUser=root|DBUser=zabbix|g' \ + -e 's|# DBSocket=/tmp/mysql.sock|DBSocket=%{_sharedstatedir}/mysql/mysql.sock|g' \ + -e 's|# ExternalScripts=\${datadir}/zabbix/externalscripts|ExternalScripts=%{_sharedstatedir}/zabbixsrv/externalscripts|' \ + -e 's|# TmpDir=\/tmp|TmpDir=%{_sharedstatedir}/zabbixsrv/tmp|' \ + -e 's|/usr/local||g' \ + conf/zabbix_server.conf + +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|# LogFileSize=.*|LogFileSize=0|g' \ + -e 's|^DBUser=root|DBUser=zabbix|g' \ + -e 's|# DBSocket=/tmp/mysql.sock|DBSocket=%{_sharedstatedir}/mysql/mysql.sock|g' \ + -e 's|# ExternalScripts=\${datadir}/zabbix/externalscripts|ExternalScripts=%{_sharedstatedir}/zabbixsrv/externalscripts|' \ + -e 's|# TmpDir=\/tmp|TmpDir=%{_sharedstatedir}/zabbixsrv/tmp|' \ + -e 's|/usr/local||g' \ + conf/zabbix_proxy.conf + +#TODO: Ticket +# Adapt man pages and SQL patches +sed -i 's|/usr/local||g;s| (if not modified during compile time).||' man/*.man +sed -i 's|/usr/local||g' \ + upgrades/dbpatches/2.0/mysql/patch.sql \ + upgrades/dbpatches/2.0/postgresql/patch.sql + +# Install README file +install -m0644 %{SOURCE16} . + + +%build + +common_flags=" + --enable-dependency-tracking + --enable-agent + --enable-proxy + --enable-ipv6 + --disable-java + --with-net-snmp + --with-ldap + --with-libcurl + --with-openipmi + --with-jabber + --with-unixodbc + --with-ssh2 +" + +# Frontend doesn't work for SQLite, thus don't build server +%configure $common_flags --with-sqlite3 +make %{?_smp_mflags} +mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_sqlite3 + +%configure $common_flags --with-mysql --enable-server +make %{?_smp_mflags} +mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_mysql +mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_mysql + +%configure $common_flags --with-postgresql --enable-server +make %{?_smp_mflags} +mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_pgsql +mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_pgsql + +# Ghosted alternatives +touch src/zabbix_server/zabbix_server +touch src/zabbix_proxy/zabbix_proxy + + +%install +# Configuration, runtime and start-up +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname} +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}/run/zabbix +mkdir -p $RPM_BUILD_ROOT%{_unitdir} +%if 0%{?rhel} +mkdir -p $RPM_BUILD_ROOT%{_initrddir} +%endif + +# Frontend +mkdir -p $RPM_BUILD_ROOT%{_datadir} + +# Home directory for the agent; +# The other home directory is created during installation +mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/zabbix + +# Install binaries +make DESTDIR=$RPM_BUILD_ROOT install +install -m 0755 -p src/zabbix_server/zabbix_server_* $RPM_BUILD_ROOT%{_sbindir}/ +install -m 0755 -p src/zabbix_proxy/zabbix_proxy_* $RPM_BUILD_ROOT%{_sbindir}/ + +# Install the frontend after removing backup files from patching +find frontends/php -name '*.orig' -exec rm {} \; +cp -a frontends/php $RPM_BUILD_ROOT%{_datadir}/%{srcname} + +# Prepare ghosted config file +#TODO: Simplify that? Like /etc/zabbix_web/zabbix.conf.php? +touch $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/web/zabbix.conf.php + +# This file is used to switch the frontend to maintenance mode +mv $RPM_BUILD_ROOT%{_datadir}/%{srcname}/conf/maintenance.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/web/maintenance.inc.php + +# Drop Apache config file in place +install -m 0644 -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{srcname}.conf + +# Install log rotation +sed -e 's|COMPONENT|agentd|g' %{SOURCE5} > \ + $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-agent +sed -e 's|COMPONENT|server|g' %{SOURCE5} > \ + $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-server +sed -e 's|COMPONENT|proxy|g' %{SOURCE5} > \ + $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-proxy + +%if 0%{?fedora} +# Install different systemd units because of the requirements for DBMS daemons +install -m 0644 -p %{SOURCE10} $RPM_BUILD_ROOT%{_unitdir}/zabbix-agent.service +install -m 0644 -p %{SOURCE11} $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy-mysql.service +install -m 0644 -p %{SOURCE12} $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy-pgsql.service +install -m 0644 -p %{SOURCE13} $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy-sqlite3.service +install -m 0644 -p %{SOURCE14} $RPM_BUILD_ROOT%{_unitdir}/zabbix-server-mysql.service +install -m 0644 -p %{SOURCE15} $RPM_BUILD_ROOT%{_unitdir}/zabbix-server-pgsql.service +%else +# Init scripts +install -m 0755 -p %{SOURCE3} $RPM_BUILD_ROOT%{_initrddir}/zabbix-agent +install -m 0755 -p %{SOURCE4} $RPM_BUILD_ROOT%{_initrddir}/zabbix-proxy +install -m 0755 -p %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/zabbix-server +%endif + +# Ghosted alternatives +touch $RPM_BUILD_ROOT%{_unitdir}/zabbix-server.service +touch $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy.service + +# Install compatibility links for config files +#TODO: Switch to .wants files instead! +ln -sf %{_sysconfdir}/zabbix_agent.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/zabbix_agent.conf +ln -sf %{_sysconfdir}/zabbix_agentd.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/zabbix_agentd.conf +ln -sf %{_sysconfdir}/zabbix_server.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/zabbix_server.conf +ln -sf %{_sysconfdir}/zabbix_proxy.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/zabbix_proxy.conf +ln -sf %{_sharedstatedir}/zabbixsrv/externalscripts $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/externalscripts +ln -sf %{_sharedstatedir}/zabbixsrv/alertscripts $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/alertscripts +#TODO: What does that do to existing directories? + +# Directory for fping spooling files +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} + 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 + cp -pR upgrades/dbpatches/2.0/$db/* $datadir/upgrades/2.0 +done + +install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{srcname}-sqlite3 +cp -p database/sqlite3/schema.sql $RPM_BUILD_ROOT%{_datadir}/%{srcname}-sqlite3 + +%if 0%{?fedora} +# 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 +%endif + + +%post server +%if 0%{?fedora} +if [ $1 -eq 1 ] ; then + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +fi +%else +/sbin/chkconfig --add zabbix-server +%endif + +if [ $1 -gt 1 ] +then + # Apply permissions also in *.rpmnew upgrades from old permissive ones + chmod 0600 %{_sysconfdir}/zabbix_server.conf + chown zabbixsrv:zabbix %{_sysconfdir}/zabbix_server.conf +fi +: + +%post server-mysql +%if 0%{?fedora} +%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_server \ + %{srcname}-server %{_sbindir}/%{srcname}_server_mysql 10 \ + --slave %{_unitdir}/zabbix-server.service %{srcname}-server-systemd \ + %{_unitdir}/zabbix-server-mysql.service +%else +%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_server \ + %{srcname}-server %{_sbindir}/%{srcname}_server_mysql 10 +%endif + +%post server-pgsql +%if 0%{?fedora} +%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_server \ + %{srcname}-server %{_sbindir}/%{srcname}_server_pgsql 10 \ + --slave %{_unitdir}/zabbix-server.service %{srcname}-server-systemd \ + %{_unitdir}/zabbix-server-pgsql.service +%else +%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_server \ + %{srcname}-server %{_sbindir}/%{srcname}_server_pgsql 10 +%endif + +%post proxy +%if 0%{?fedora} +if [ $1 -eq 1 ] ; then + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +fi +%else +/sbin/chkconfig --add zabbix-proxy +%endif + +if [ $1 -gt 1 ] +then + # Apply permissions also in *.rpmnew upgrades from old permissive ones + chmod 0600 %{_sysconfdir}/zabbix_proxy.conf + chown zabbixsrv:zabbix %{_sysconfdir}/zabbix_proxy.conf +fi +: + +%post proxy-mysql +%if 0%{?fedora} +%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ + %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_mysql 10 \ + --slave %{_unitdir}/zabbix-proxy.service %{srcname}-proxy-systemd \ + %{_unitdir}/zabbix-proxy-mysql.service +%else +%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ + %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_mysql 10 +%endif + +%post proxy-pgsql +%if 0%{?fedora} +%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ + %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_pgsql 10 \ + --slave %{_unitdir}/zabbix-proxy.service %{srcname}-proxy-systemd \ + %{_unitdir}/zabbix-proxy-pgsql.service +%else +%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ + %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_pgsql 10 +%endif + +%post proxy-sqlite3 +%if 0%{?fedora} +%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ + %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_sqlite3 10 \ + --slave %{_unitdir}/zabbix-proxy.service %{srcname}-proxy-systemd \ + %{_unitdir}/zabbix-proxy-sqlite3.service +%else +%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ + %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_sqlite3 10 +%endif + +%pre agent +getent group zabbix > /dev/null || groupadd -r zabbix +getent passwd zabbix > /dev/null || \ + useradd -r -g zabbix -d %{_sharedstatedir}/zabbix -s /sbin/nologin \ + -c "Zabbix Monitoring System" zabbix +: + +%post agent +if [ $1 -eq 1 ] ; then +%if 0%{?fedora} + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%else + /sbin/chkconfig --add zabbix-agent || : +%endif +fi + +%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 \ + -c "Zabbix Monitoring System -- Proxy or server" zabbixsrv +: + +%preun server +if [ $1 -eq 0 ] +then +%if 0%{?fedora} + /bin/systemctl --no-reload disable zabbix-server.service > /dev/null 2>&1 || : + /bin/systemctl stop zabbix-server.service > /dev/null 2>&1 || : +%else + /sbin/service zabbix-server stop >/dev/null 2>&1 + /sbin/chkconfig --del zabbix-server +%endif +fi +: + +#TODO: Update path from 1.8.6 with wrongly set home dir? +%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 \ + -c "Zabbix Monitoring System -- Proxy or server" zabbixsrv +: + +%preun proxy +if [ $1 -eq 0 ] +then +%if 0%{?fedora} + /bin/systemctl --no-reload disable zabbix-proxy.service > /dev/null 2>&1 || : + /bin/systemctl stop zabbix-proxy.service > /dev/null 2>&1 || : +%else + /sbin/service zabbix-proxy stop >/dev/null 2>&1 + /sbin/chkconfig --del zabbix-proxy +%endif +fi +: + +%preun agent +if [ $1 -eq 0 ] ; then +%if 0%{?fedora} + /bin/systemctl --no-reload disable zabbix-agent.service > /dev/null 2>&1 || : + /bin/systemctl stop zabbix-agent.service > /dev/null 2>&1 || : +%else + /sbin/service zabbix-agent stop >/dev/null 2>&1 + /sbin/chkconfig --del zabbix-agent +%endif +fi +: + +%postun server +%if 0%{?fedora} + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%endif + +if [ $1 -ge 1 ] ; then +%if 0%{?fedora} + /bin/systemctl try-restart zabbix-server.service >/dev/null 2>&1 || : +%else + /sbin/service zabbix-server try-restart >/dev/null 2>&1 || : +%endif +fi + +%postun server-mysql +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove %{srcname}-server %{_sbindir}/%{srcname}_server_mysql +fi + +%postun server-pgsql +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove %{srcname}-server %{_sbindir}/%{srcname}_server_pgsql +fi + +%postun proxy +%if 0%{?fedora} + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%endif + +if [ $1 -ge 1 ] ; then +%if 0%{?fedora} + /bin/systemctl try-restart zabbix-proxy.service >/dev/null 2>&1 || : +%else + /sbin/service zabbix-proxy try-restart >/dev/null 2>&1 || : +%endif +fi + +%postun proxy-mysql +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_mysql +fi + +%postun proxy-pgsql +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_pgsql +fi + +%postun proxy-sqlite3 +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_sqlite3 +fi + +%postun agent +%if 0%{?fedora} + /bin/systemctl daemon-reload >/dev/null 2>&1 || : +%endif + +if [ $1 -ge 1 ] ; then +%if 0%{?fedora} + /bin/systemctl try-restart zabbix-agent.service >/dev/null 2>&1 || : +%else + /sbin/service zabbix-agent try-restart >/dev/null 2>&1 || : +%endif +fi + + +%files +%doc AUTHORS ChangeLog COPYING NEWS README %{srcname}-fedora.README +%dir %{_sysconfdir}/%{srcname} +%config(noreplace) %{_sysconfdir}/zabbix_agentd.conf +%config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_agentd.conf +%if 0%{?fedora} +%config(noreplace) %{_sysconfdir}/tmpfiles.d/zabbix.conf +%endif +%{_bindir}/zabbix_get +%{_bindir}/zabbix_sender +%{_mandir}/man1/zabbix_get.1* +%{_mandir}/man1/zabbix_sender.1* + +%files server +%doc misc/snmptrap/zabbix_trap_receiver.pl +%attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix +%if 0%{?rhel} +%attr(0775,root,zabbix) %dir %{_localstatedir}/run/zabbix +%endif +%attr(0600,zabbixsrv,zabbix) %config(noreplace) %{_sysconfdir}/zabbix_server.conf +%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 +%if 0%{?fedora} +%ghost %{_unitdir}/zabbix-server.service +%else +%{_initrddir}/zabbix-server +%endif +%{_mandir}/man8/zabbix_server.8* + +%files server-mysql +%{_datadir}/%{srcname}-mysql +%{_sbindir}/zabbix_server_mysql +%if 0%{?fedora} +%{_unitdir}/zabbix-server-mysql.service +%endif + +%files server-pgsql +%{_datadir}/%{srcname}-postgresql +%{_sbindir}/zabbix_server_pgsql +%if 0%{?fedora} +%{_unitdir}/zabbix-server-pgsql.service +%endif + +%files agent +%doc conf/zabbix_agentd/*.conf +%attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix +%if 0%{?rhel} +%attr(0775,root,zabbix) %dir %{_localstatedir}/run/zabbix +%endif +%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 +%if 0%{?fedora} +%{_unitdir}/zabbix-agent.service +%else +%{_initrddir}/zabbix-agent +%endif +%{_sbindir}/zabbix_agent +%{_sbindir}/zabbix_agentd +%{_mandir}/man8/zabbix_agentd.8* + +%files proxy +%doc misc/snmptrap/zabbix_trap_receiver.pl +%attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix +%if 0%{?rhel} +%attr(0775,root,zabbix) %dir %{_localstatedir}/run/zabbix +%endif +%attr(0600,zabbixsrv,zabbix) %config(noreplace) %{_sysconfdir}/zabbix_proxy.conf +%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 +%if 0%{?fedora} +%ghost %{_unitdir}/zabbix-proxy.service +%else +%{_initrddir}/zabbix-proxy +%endif +%{_mandir}/man8/zabbix_proxy.8* + +%files proxy-mysql +%{_datadir}/%{srcname}-mysql +%{_sbindir}/zabbix_proxy_mysql +%if 0%{?fedora} +%{_unitdir}/zabbix-proxy-mysql.service +%endif + +%files proxy-pgsql +%{_datadir}/%{srcname}-postgresql +%{_sbindir}/zabbix_proxy_pgsql +%if 0%{?fedora} +%{_unitdir}/zabbix-proxy-pgsql.service +%endif + +%files proxy-sqlite3 +%{_datadir}/%{srcname}-sqlite3 +%{_sbindir}/zabbix_proxy_sqlite3 +%if 0%{?fedora} +%{_unitdir}/zabbix-proxy-sqlite3.service +%endif + +%files web +%dir %attr(0750,apache,apache) %{_sysconfdir}/%{srcname}/web +%ghost %attr(0644,apache,apache) %config(noreplace) %{_sysconfdir}/%{srcname}/web/zabbix.conf.php +%attr(0644,apache,apache) %config(noreplace) %{_sysconfdir}/%{srcname}/web/maintenance.inc.php +%config(noreplace) %{_sysconfdir}/httpd/conf.d/zabbix.conf +%{_datadir}/%{srcname} + +%files web-mysql + +%files web-pgsql + +%changelog +* Wed Feb 12 2014 Volker Fröhlich - 2.0.11-1 +- New upstream release +- Truncate changelog + +* Sun Dec 15 2013 Volker Fröhlich - 2.0.10-2 +- The start function of the proxy init script had a typo causing failure +- Improved the section on running multiple instances in the README + +* Fri Dec 13 2013 Volker Fröhlich - 2.0.10-1 +- New upstream release +- Drop obsolete patch ZBX-7479 +- Improve init scripts to not kill other instances (BZ#1018293) +- General overhaul of init scripts and documentation in README +- Harmonize scriptlet if-clause style + +* Sun Nov 3 2013 Volker Fröhlich - 2.0.9-2 +- Fix vulnerability for remote command execution injection + (ZBX-7479, CVE-2013-6824) + +* Wed Oct 9 2013 Volker Fröhlich - 2.0.9-1 +- New upstream release +- Drop obsolete patches ZBX-6804, ZBX-7091, ZBX-6922, ZBX-6992 + +* Mon Sep 23 2013 Volker Fröhlich - 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) + +* Fri Sep 13 2013 Volker Fröhlich - 2.0.8-2 +- Add php-ldap as a requirement for the frontend +- Add patch for ZBX-6992 + +* Fri Aug 23 2013 Volker Fröhlich - 2.0.8-1 +- New upstream release +- Create and configure a spooling directory for fping files outside of /tmp +- Update README to reflect that and add a SELinux section +- Drop PrivateTmp from systemd unit files +- Drop patch for ZBX-6526 (solved upstream) +- Drop patch for CVE-2012-6086 (solved upstream) +- Correct path for the flash applet when removing +- Truncate changelog + +* Tue Jul 30 2013 Volker Fröhlich - 2.0.6-3 +- Backport fix for CVE-2012-6086 + +* Tue May 07 2013 Volker Fröhlich - 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 - 2.0.6-1 +- New upstream release +- Drop ZBX-6290 and ZBX-6318 patches + +* Tue Mar 19 2013 Volker Fröhlich - 2.0.5-3 +- Include patch for ZBX-6318 + +* Tue Feb 12 2013 Volker Fröhlich - 2.0.5-2 +- Include patch for ZBX-6290 + +* Tue Feb 12 2013 Volker Fröhlich - 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 - 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 - 2.0.4-4 +- Remove zabbix_get plus manpage from the proxy files section +- Solve conflict for externalscripts symlink between proxy and + server package + +* Thu Jan 17 2013 Volker Fröhlich - 2.0.4-3 +- Patch for CVE-2013-1364 + +* Mon Jan 14 2013 Volker Fröhlich - 2.0.4-2 +- 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 + +* Sat Dec 8 2012 Volker Fröhlich - 2.0.4-1 +- New upstream release + +* Fri Dec 7 2012 Volker Fröhlich - 2.0.3-7 +- Add SNMP source IP address patch + +* Mon Nov 26 2012 Volker Fröhlich - 2.0.3-6 +- Apply fping 3 patch only for Fedora + +* Tue Nov 13 2012 Volker Fröhlich - 2.0.3-5 +- Adapt httpd configuration file for Apache 2.4 (BZ#871498) + +* Thu Nov 8 2012 Volker Fröhlich - 2.0.3-4 +- Require php explicitly again +- Remove traces of /usr/local in configuration files +- Improve Fedora README file + +* Sun Oct 14 2012 Volker Fröhlich - 2.0.3-3 +- Correct capitalization in unit files, init scripts and package description +- Improve sysconfig sourcing in init scripts +- Correct post-script permissions and owner on rpmnew files +- Obsolete sqlite web and server sub-package + +* Sun Oct 14 2012 Volker Fröhlich - 2.0.3-2 +- Include agent configuration file in base package for zabbix_sender +- Stricter permissions for server config file +- Adapt DB patches to our file layout +- Remove conditional around Source9 +- doc-sub-package obsolete only for Fedora, where the package keeps + the name "zabbix" +- Add missing requirement for proxy scriplet +- Remove Requires php because the PHP modules serve this purpose +- Use systemd's PrivateTmp only for F17 and up +- Correct proxy and server pre-scriplet (usergroup) + +* Fri Oct 5 2012 Volker Fröhlich - 2.0.3-1 +- New upstream release +- Add Fedora specific README + +* Mon Aug 27 2012 Volker Fröhlich - 2.0.2-3 +- Eliminate Sqlite server and web sub-package + They never worked and are considered experimental by upstream +- Harmonize conditionals +- Put maintenance configuration in web configuration directory +- Adapt man pages to file layout +- Remove backup files from frontend +- Move maintenance configuration file to /etc/... +- Move ExternalScripts and AlertScripts to daemon home directory +- Don't ship SQL scripts as documentation + +* Sun Aug 26 2012 Volker Fröhlich - 2.0.2-2 +- Use separate daemon users, so the agent can not parse the + database password +- Use PrivateTmp in unit files + +* Wed Aug 15 2012 Volker Fröhlich - 2.0.2-1 +- New upstream release +- Unified specfile for sys-v-init scripts and systemd +- Switch to Alternatives system +- Source from systemconfig in init scripts + +* Sun Jul 22 2012 Fedora Release Engineering - 2.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jul 12 2012 Dan Horák - 2.0.1-1 +- update to 2.0.1 +- rebased patches +- upstream location (/etc) for config files is used with symlinks to the old /etc/zabbix +- dropped our own SNMP trap processor, upstream one running directly under net-snmp daemon is used instead +- moved zabbix_get and zabbix_sender tools to the main package + +* Thu Jun 28 2012 Dan Horák - 1.8.14-1 +- update to 1.8.14 + +* Sat May 12 2012 Dan Horák - 1.8.13-1 +- update to 1.8.13 + +* Tue Apr 24 2012 Dan Horák - 1.8.12-1 +- update to 1.8.12 + +* Wed Mar 21 2012 Dan Horák - 1.8.11-1 +- update to 1.8.11 + +* Sat Jan 14 2012 Fedora Release Engineering - 1.8.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Dec 28 2011 Dan Horák - 1.8.10-1 +- update to 1.8.10 (fixes CVE-2011-4615) + +* Thu Nov 24 2011 Dan Horák - 1.8.9-1 +- update to 1.8.9 +- switch to systemd units (#720065) +- drop empty docs subpackage +- drop spec compatibility with sysv-based systems + +* Wed Oct 5 2011 Dan Horák - 1.8.8-1 +- Update for 1.8.8 +- Drop the ZBX-4099 patch, that's now obsolete +- Remove two further htaccess files and put the configuration in + the main configuration file +- thanks to Volker Fröhlich for the changes above +- move zabbix_get to the server and proxy subpackages (#734512) +- remove prebuilt Windows binaries (#737341) +- remove flash clock applet (#737337) + +* Fri Sep 9 2011 Dan Horák - 1.8.7-2 +- fix server crash (ZBX-4099) + +* Mon Sep 5 2011 Dan Horák - 1.8.7-1 +- updated to 1.8.7 + +* Tue Aug 9 2011 Dan Horák - 1.8.6-1 +- updated to 1.8.6 (#729164, #729165) +- updated user/group adding scriptlet + +* Fri Jul 8 2011 Dan Horák - 1.8.5-5 +- rebuilt with net-snmp 5.7 + +* Mon Jun 13 2011 Dan Horák - 1.8.5-4 +- generalize the spec so creating packages like zabbix18 will be much easier + +* Fri Jun 3 2011 Dan Horák - 1.8.5-3 +- fix path to the traceroute utility +- add tmpfiles.d support for /var/run/zabbix (#656726) + +* Mon May 23 2011 Dan Horák - 1.8.5-2 +- include /var/lib/zabbix and /etc/zabbix/externalscripts dirs in package (#704181) +- add snmp trap receiver script in package (#705331) + +* Wed Apr 20 2011 Dan Horák - 1.8.5-1 +- updated to 1.8.5 + +* Wed Mar 23 2011 Dan Horák - 1.8.4-4 +- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient) + +* Tue Feb 08 2011 Fedora Release Engineering - 1.8.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jan 18 2011 Dan Horák - 1.8.4-2 +- enable libcurl detection (#670500) + +* Tue Jan 4 2011 Dan Horák - 1.8.4-1 +- updated to 1.8.4 +- fixes zabbix_agent fail to start on IPv4-only host (#664639) + +* Tue Nov 23 2010 Dan Horák - 1.8.3-5 +- zabbix emailer doesn't handle multiline responses (#656072) + +* Mon Nov 1 2010 Dan Horák - 1.8.3-4 +- rebuilt with net-snmp 5.6 + +* Wed Sep 29 2010 jkeating - 1.8.3-3 +- Rebuilt for gcc bug 634757 + +* Mon Sep 6 2010 Dan Horák - 1.8.3-2 +- fix font path in patch2 (#630500) + +* Tue Aug 17 2010 Dan Horák - 1.8.3-1 +- updated to 1.8.3 + +* Wed Aug 11 2010 Dan Horák - 1.8.2-3 +- added patch for XSS in triggers page (#620809, ZBX-2326) + +* Thu Apr 29 2010 Dan Horák - 1.8.2-2 +- DejaVu fonts doesn't exist on EL <= 5 + +* Tue Mar 30 2010 Dan Horák - 1.8.2-1 +- Update to 1.8.2 + +* Sat Mar 20 2010 Dan Horák - 1.8.1-7 +- web interface needs php-xml (#572413) +- updated defaults in config files (#573325) +- built with libssh2 support (#575279) + +* Wed Feb 24 2010 Dan Horák - 1.8.1-6 +- use system fonts + +* Sat Feb 13 2010 Dan Horák - 1.8.1-5 +- fixed linking with the new --no-add-needed default (#564932) + +* Mon Feb 1 2010 Dan Horák - 1.8.1-4 +- enable dependency tracking + +* Mon Feb 1 2010 Dan Horák - 1.8.1-3 +- updated the web-config patch + +* Mon Feb 1 2010 Dan Horák - 1.8.1-2 +- close fd on exec (#559221) + +* Fri Jan 29 2010 Dan Horák - 1.8.1-1 +- Update to 1.8.1 + +* Tue Jan 26 2010 Dan Horák - 1.8-1 +- Update to 1.8 From 1634cedd44556b01ee050f46b42384a46404ee28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Sun, 16 Feb 2014 16:15:35 +0100 Subject: [PATCH 02/12] Remove all conditionals, use systemd macros - Remove all conditionals for Fedora/RHEL, as the are obsolete - Use systemd macros in scriptlets - Remove init script sources - Shorten changelog --- zabbix-agent.init | 89 ----------- zabbix-proxy.init | 87 ----------- zabbix-server.init | 87 ----------- zabbix20.spec | 363 +++++---------------------------------------- 4 files changed, 33 insertions(+), 593 deletions(-) delete mode 100644 zabbix-agent.init delete mode 100644 zabbix-proxy.init delete mode 100644 zabbix-server.init diff --git a/zabbix-agent.init b/zabbix-agent.init deleted file mode 100644 index cb97acf..0000000 --- a/zabbix-agent.init +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -# -# chkconfig: - 86 14 -# description: Zabbix agent daemon -# - -### BEGIN INIT INFO -# Provides: zabbix-agent -# Required-Start: $local_fs $network -# Required-Stop: $local_fs $network -# Should-Start: zabbix-server zabbix-proxy -# Should-Stop: zabbix-server zabbix-proxy -# Default-Start: -# Default-Stop: 0 1 2 3 4 5 6 -# Short-Description: Start and stop Zabbix agent -# Description: Zabbix agent daemon -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -exec=/usr/sbin/zabbix_agentd -prog=${exec##*/} -syscf=${0##*/} -lockfile=/var/lock/subsys/$syscf - -[ -f /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf - -config=${CFG_FILE:-/etc/zabbix_agentd.conf} -if [ ! -f $config ]; then - echo "Not starting Zabbix agent: Config file $config not found!" - echo "Check /etc/sysconfig/$syscf" - exit 3 -fi - -pidfile=$(grep -e "^PidFile=.*$" $config | cut -d= -f2) -param="-c $config" - -start() -{ - echo -n $"Starting Zabbix agent: " - daemon --user zabbix --pidfile "$pidfile" $exec $param - rv=$? - echo - [ $rv -eq 0 ] && touch $lockfile - return $rv -} - -stop() -{ - echo -n $"Shutting down Zabbix agent: " - killproc -p "$pidfile" $prog - rv=$? - echo - [ $rv -eq 0 ] && rm -f $lockfile - return $rv -} - -restart() -{ - stop - start -} - -case "$1" in - start|stop|restart) - $1 - ;; - force-reload) - restart - ;; - status) - status -p "$pidfile" -l $prog $exec - ;; - try-restart|condrestart) - if status -p "$pidfile" -l $prog $exec >/dev/null ; then - restart - fi - ;; - reload) - action $"Service ${0##*/} does not support the reload action: " /bin/false - exit 3 - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" - exit 2 - ;; -esac - diff --git a/zabbix-proxy.init b/zabbix-proxy.init deleted file mode 100644 index e3b2283..0000000 --- a/zabbix-proxy.init +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh -# -# chkconfig: - 85 15 -# description: Zabbix proxy daemon -# - -### BEGIN INIT INFO -# Provides: zabbix-proxy -# Required-Start: $local_fs $network -# Required-Stop: $local_fs $network -# Default-Start: -# Default-Stop: 0 1 2 3 4 5 6 -# Short-Description: Start and stop Zabbix proxy -# Description: Zabbix proxy daemon -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -exec=/usr/sbin/zabbix_proxy -prog=${exec##*/} -syscf=${0##*/} -lockfile=/var/lock/subsys/$syscf - -[ -f /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf - -config=${CFG_FILE:-/etc/zabbix_proxy.conf} -if [ ! -f $config ]; then - echo "Not starting Zabbix proxy: Config file $config not found!" - echo "Check /etc/sysconfig/$syscf" - exit 3 -fi - -pidfile=$(grep -e "^PidFile=.*$" $config | cut -d= -f2) -param="-c $config" - -start() -{ - echo -n $"Starting Zabbix proxy: " - daemon --user zabbixsrv --pidfile "$pidfile" $exec $param - rv=$? - echo - [ $rv -eq 0 ] && touch $lockfile - return $rv -} - -stop() -{ - echo -n $"Shutting down Zabbix proxy: " - killproc -p "$pidfile" $prog - rv=$? - echo - [ $rv -eq 0 ] && rm -f $lockfile - return $rv -} - -restart() -{ - stop - start -} - -case "$1" in - start|stop|restart) - $1 - ;; - force-reload) - restart - ;; - status) - status -p "$pidfile" -l $prog $exec - ;; - try-restart|condrestart) - if status -p "$pidfile" -l $prog $exec >/dev/null ; then - restart - fi - ;; - reload) - action $"Service ${0##*/} does not support the reload action: " /bin/false - exit 3 - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" - exit 2 - ;; -esac - diff --git a/zabbix-server.init b/zabbix-server.init deleted file mode 100644 index 0dd2710..0000000 --- a/zabbix-server.init +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh -# -# chkconfig: - 85 15 -# description: Zabbix server daemon -# - -### BEGIN INIT INFO -# Provides: zabbix-server -# Required-Start: $local_fs $network -# Required-Stop: $local_fs $network -# Default-Start: -# Default-Stop: 0 1 2 3 4 5 6 -# Short-Description: Start and stop Zabbix server -# Description: Zabbix server daemon -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -exec=/usr/sbin/zabbix_server -prog=${exec##*/} -syscf=${0##*/} -lockfile=/var/lock/subsys/$syscf - -[ -f /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf - -config=${CFG_FILE:-/etc/zabbix_server.conf} -if [ ! -f $config ]; then - echo "Not starting Zabbix server: Config file $config not found!" - echo "Check /etc/sysconfig/$syscf" - exit 3 -fi - -pidfile=$(grep -e "^PidFile=.*$" $config | cut -d= -f2) -param="-c $config" - -start() -{ - echo -n $"Starting Zabbix server: " - daemon --user zabbixsrv --pidfile "$pidfile" $exec $param - rv=$? - echo - [ $rv -eq 0 ] && touch $lockfile - return $rv -} - -stop() -{ - echo -n $"Shutting down Zabbix server: " - killproc -p "$pidfile" $prog - rv=$? - echo - [ $rv -eq 0 ] && rm -f $lockfile - return $rv -} - -restart() -{ - stop - start -} - -case "$1" in - start|stop|restart) - $1 - ;; - force-reload) - restart - ;; - status) - status -p "$pidfile" -l $prog $exec - ;; - try-restart|condrestart) - if status -p "$pidfile" -l $prog $exec >/dev/null ; then - restart - fi - ;; - reload) - action $"Service ${0##*/} does not support the reload action: " /bin/false - exit 3 - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" - exit 2 - ;; -esac - diff --git a/zabbix20.spec b/zabbix20.spec index 2718d4c..2786cb5 100644 --- a/zabbix20.spec +++ b/zabbix20.spec @@ -19,7 +19,7 @@ Name: zabbix20 Version: 2.0.11 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Open-source monitoring solution for your IT infrastructure Group: Applications/Internet @@ -29,9 +29,6 @@ URL: http://www.zabbix.com # upstream tarball minus src/zabbix_java/lib/org-json-2010-12-28.jar Source0: %{srcname}-%{version}-free.tar.gz Source1: %{srcname}-web.conf -Source2: %{srcname}-server.init -Source3: %{srcname}-agent.init -Source4: %{srcname}-proxy.init Source5: %{srcname}-logrotate.in Source9: %{srcname}-tmpfiles.conf # systemd units -- Alternatives switches between them (they state their dependencies) @@ -66,9 +63,7 @@ BuildRequires: unixODBC-devel BuildRequires: curl-devel BuildRequires: OpenIPMI-devel BuildRequires: libssh2-devel -%if 0%{?fedora} -BuildRequires: systemd-units -%endif +BuildRequires: systemd Requires: logrotate # Could alternatively be conditional on Fedora/EL @@ -104,16 +99,9 @@ Requires: %{name}-server-implementation = %{version}-%{release} Requires: fping Requires: traceroute Requires(pre): shadow-utils -%if 0%{?fedora} -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units -%else -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/chkconfig -Requires(preun): /sbin/service -Requires(postun): /sbin/service -%endif +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd %description server Zabbix server common files @@ -149,16 +137,9 @@ Summary: Zabbix Agent Group: Applications/Internet Requires: %{name} = %{version}-%{release} Requires(pre): shadow-utils -%if 0%{?fedora} -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units -%else -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/chkconfig -Requires(preun): /sbin/service -Requires(postun): /sbin/service -%endif +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd %description agent The Zabbix client agent, to be installed on monitored systems. @@ -169,16 +150,9 @@ Group: Applications/Internet Requires: %{name} = %{version}-%{release} Requires: %{name}-proxy-implementation = %{version}-%{release} Requires(pre): shadow-utils -%if 0%{?fedora} -Requires(post): systemd-units -Requires(preun): systemd-units -Requires(postun): systemd-units -%else -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/chkconfig -Requires(preun): /sbin/service -Requires(postun): /sbin/service -%endif +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd Requires: fping %description proxy @@ -268,20 +242,17 @@ Zabbix web frontend for PostgreSQL %setup0 -q -n %{srcname}-%{version} %patch0 -p1 %patch1 -p1 -%if 0%{?fedora} -%patch3 -p1 -%endif - -# Logrotate's su option is currently only available in Fedora -%if 0%{?rhel} -sed -i '/su zabbix zabbix/d' %{SOURCE5} -%endif # Remove flash applet # https://support.zabbix.com/browse/ZBX-4794 %patch2 -p1 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 @@ -402,9 +373,6 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/zabbix mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/zabbix mkdir -p $RPM_BUILD_ROOT%{_unitdir} -%if 0%{?rhel} -mkdir -p $RPM_BUILD_ROOT%{_initrddir} -%endif # Frontend mkdir -p $RPM_BUILD_ROOT%{_datadir} @@ -440,7 +408,6 @@ sed -e 's|COMPONENT|server|g' %{SOURCE5} > \ sed -e 's|COMPONENT|proxy|g' %{SOURCE5} > \ $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-proxy -%if 0%{?fedora} # Install different systemd units because of the requirements for DBMS daemons install -m 0644 -p %{SOURCE10} $RPM_BUILD_ROOT%{_unitdir}/zabbix-agent.service install -m 0644 -p %{SOURCE11} $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy-mysql.service @@ -448,12 +415,6 @@ install -m 0644 -p %{SOURCE12} $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy-pgsql.ser install -m 0644 -p %{SOURCE13} $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy-sqlite3.service install -m 0644 -p %{SOURCE14} $RPM_BUILD_ROOT%{_unitdir}/zabbix-server-mysql.service install -m 0644 -p %{SOURCE15} $RPM_BUILD_ROOT%{_unitdir}/zabbix-server-pgsql.service -%else -# Init scripts -install -m 0755 -p %{SOURCE3} $RPM_BUILD_ROOT%{_initrddir}/zabbix-agent -install -m 0755 -p %{SOURCE4} $RPM_BUILD_ROOT%{_initrddir}/zabbix-proxy -install -m 0755 -p %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/zabbix-server -%endif # Ghosted alternatives touch $RPM_BUILD_ROOT%{_unitdir}/zabbix-server.service @@ -485,24 +446,15 @@ done install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{srcname}-sqlite3 cp -p database/sqlite3/schema.sql $RPM_BUILD_ROOT%{_datadir}/%{srcname}-sqlite3 -%if 0%{?fedora} # 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 -%endif %post server -%if 0%{?fedora} -if [ $1 -eq 1 ] ; then - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -fi -%else -/sbin/chkconfig --add zabbix-server -%endif +%systemd_post zabbix-server.service -if [ $1 -gt 1 ] -then +if [ $1 -gt 1 ] ; then # Apply permissions also in *.rpmnew upgrades from old permissive ones chmod 0600 %{_sysconfdir}/zabbix_server.conf chown zabbixsrv:zabbix %{_sysconfdir}/zabbix_server.conf @@ -510,38 +462,21 @@ fi : %post server-mysql -%if 0%{?fedora} %{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_server \ %{srcname}-server %{_sbindir}/%{srcname}_server_mysql 10 \ --slave %{_unitdir}/zabbix-server.service %{srcname}-server-systemd \ %{_unitdir}/zabbix-server-mysql.service -%else -%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_server \ - %{srcname}-server %{_sbindir}/%{srcname}_server_mysql 10 -%endif %post server-pgsql -%if 0%{?fedora} %{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_server \ %{srcname}-server %{_sbindir}/%{srcname}_server_pgsql 10 \ --slave %{_unitdir}/zabbix-server.service %{srcname}-server-systemd \ %{_unitdir}/zabbix-server-pgsql.service -%else -%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_server \ - %{srcname}-server %{_sbindir}/%{srcname}_server_pgsql 10 -%endif %post proxy -%if 0%{?fedora} -if [ $1 -eq 1 ] ; then - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -fi -%else -/sbin/chkconfig --add zabbix-proxy -%endif +%systemd_post zabbix-proxy.service -if [ $1 -gt 1 ] -then +if [ $1 -gt 1 ] ; then # Apply permissions also in *.rpmnew upgrades from old permissive ones chmod 0600 %{_sysconfdir}/zabbix_proxy.conf chown zabbixsrv:zabbix %{_sysconfdir}/zabbix_proxy.conf @@ -549,37 +484,22 @@ fi : %post proxy-mysql -%if 0%{?fedora} %{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_mysql 10 \ --slave %{_unitdir}/zabbix-proxy.service %{srcname}-proxy-systemd \ %{_unitdir}/zabbix-proxy-mysql.service -%else -%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ - %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_mysql 10 -%endif %post proxy-pgsql -%if 0%{?fedora} %{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_pgsql 10 \ --slave %{_unitdir}/zabbix-proxy.service %{srcname}-proxy-systemd \ %{_unitdir}/zabbix-proxy-pgsql.service -%else -%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ - %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_pgsql 10 -%endif %post proxy-sqlite3 -%if 0%{?fedora} %{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_sqlite3 10 \ --slave %{_unitdir}/zabbix-proxy.service %{srcname}-proxy-systemd \ %{_unitdir}/zabbix-proxy-sqlite3.service -%else -%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ - %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_sqlite3 10 -%endif %pre agent getent group zabbix > /dev/null || groupadd -r zabbix @@ -589,13 +509,7 @@ getent passwd zabbix > /dev/null || \ : %post agent -if [ $1 -eq 1 ] ; then -%if 0%{?fedora} - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -%else - /sbin/chkconfig --add zabbix-agent || : -%endif -fi +%systemd_post zabbix-agent.service %pre server getent group zabbix > /dev/null || groupadd -r zabbix @@ -605,19 +519,8 @@ getent passwd zabbixsrv > /dev/null || \ : %preun server -if [ $1 -eq 0 ] -then -%if 0%{?fedora} - /bin/systemctl --no-reload disable zabbix-server.service > /dev/null 2>&1 || : - /bin/systemctl stop zabbix-server.service > /dev/null 2>&1 || : -%else - /sbin/service zabbix-server stop >/dev/null 2>&1 - /sbin/chkconfig --del zabbix-server -%endif -fi -: + %systemd_preun zabbix-server.service -#TODO: Update path from 1.8.6 with wrongly set home dir? %pre proxy getent group zabbix > /dev/null || groupadd -r zabbix getent passwd zabbixsrv > /dev/null || \ @@ -626,42 +529,13 @@ getent passwd zabbixsrv > /dev/null || \ : %preun proxy -if [ $1 -eq 0 ] -then -%if 0%{?fedora} - /bin/systemctl --no-reload disable zabbix-proxy.service > /dev/null 2>&1 || : - /bin/systemctl stop zabbix-proxy.service > /dev/null 2>&1 || : -%else - /sbin/service zabbix-proxy stop >/dev/null 2>&1 - /sbin/chkconfig --del zabbix-proxy -%endif -fi -: +%systemd_preun zabbix-proxy.service %preun agent -if [ $1 -eq 0 ] ; then -%if 0%{?fedora} - /bin/systemctl --no-reload disable zabbix-agent.service > /dev/null 2>&1 || : - /bin/systemctl stop zabbix-agent.service > /dev/null 2>&1 || : -%else - /sbin/service zabbix-agent stop >/dev/null 2>&1 - /sbin/chkconfig --del zabbix-agent -%endif -fi -: +%systemd_preun zabbix-agent.service %postun server -%if 0%{?fedora} - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -%endif - -if [ $1 -ge 1 ] ; then -%if 0%{?fedora} - /bin/systemctl try-restart zabbix-server.service >/dev/null 2>&1 || : -%else - /sbin/service zabbix-server try-restart >/dev/null 2>&1 || : -%endif -fi +%systemd_postun_with_restart zabbix-server.service %postun server-mysql if [ $1 -eq 0 ] ; then @@ -674,17 +548,7 @@ if [ $1 -eq 0 ] ; then fi %postun proxy -%if 0%{?fedora} - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -%endif - -if [ $1 -ge 1 ] ; then -%if 0%{?fedora} - /bin/systemctl try-restart zabbix-proxy.service >/dev/null 2>&1 || : -%else - /sbin/service zabbix-proxy try-restart >/dev/null 2>&1 || : -%endif -fi +%systemd_postun_with_restart zabbix-proxy.service %postun proxy-mysql if [ $1 -eq 0 ] ; then @@ -702,17 +566,7 @@ if [ $1 -eq 0 ] ; then fi %postun agent -%if 0%{?fedora} - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -%endif - -if [ $1 -ge 1 ] ; then -%if 0%{?fedora} - /bin/systemctl try-restart zabbix-agent.service >/dev/null 2>&1 || : -%else - /sbin/service zabbix-agent try-restart >/dev/null 2>&1 || : -%endif -fi +%systemd_postun_with_restart zabbix-agent.service %files @@ -720,9 +574,8 @@ fi %dir %{_sysconfdir}/%{srcname} %config(noreplace) %{_sysconfdir}/zabbix_agentd.conf %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_agentd.conf -%if 0%{?fedora} +#TODO: Will it complain about non-existing zabbixsrv? %config(noreplace) %{_sysconfdir}/tmpfiles.d/zabbix.conf -%endif %{_bindir}/zabbix_get %{_bindir}/zabbix_sender %{_mandir}/man1/zabbix_get.1* @@ -731,9 +584,6 @@ fi %files server %doc misc/snmptrap/zabbix_trap_receiver.pl %attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix -%if 0%{?rhel} -%attr(0775,root,zabbix) %dir %{_localstatedir}/run/zabbix -%endif %attr(0600,zabbixsrv,zabbix) %config(noreplace) %{_sysconfdir}/zabbix_server.conf %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_server.conf %config(noreplace) %{_sysconfdir}/%{srcname}/externalscripts @@ -741,44 +591,29 @@ fi %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix-server %ghost %{_sbindir}/zabbix_server %attr(0755,zabbixsrv,zabbix) %{_sharedstatedir}/zabbixsrv -%if 0%{?fedora} %ghost %{_unitdir}/zabbix-server.service -%else -%{_initrddir}/zabbix-server -%endif %{_mandir}/man8/zabbix_server.8* %files server-mysql %{_datadir}/%{srcname}-mysql %{_sbindir}/zabbix_server_mysql -%if 0%{?fedora} %{_unitdir}/zabbix-server-mysql.service -%endif %files server-pgsql %{_datadir}/%{srcname}-postgresql %{_sbindir}/zabbix_server_pgsql -%if 0%{?fedora} %{_unitdir}/zabbix-server-pgsql.service -%endif %files agent %doc conf/zabbix_agentd/*.conf %attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix -%if 0%{?rhel} -%attr(0775,root,zabbix) %dir %{_localstatedir}/run/zabbix -%endif %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 -%if 0%{?fedora} %{_unitdir}/zabbix-agent.service -%else -%{_initrddir}/zabbix-agent -%endif %{_sbindir}/zabbix_agent %{_sbindir}/zabbix_agentd %{_mandir}/man8/zabbix_agentd.8* @@ -786,42 +621,29 @@ fi %files proxy %doc misc/snmptrap/zabbix_trap_receiver.pl %attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix -%if 0%{?rhel} -%attr(0775,root,zabbix) %dir %{_localstatedir}/run/zabbix -%endif %attr(0600,zabbixsrv,zabbix) %config(noreplace) %{_sysconfdir}/zabbix_proxy.conf %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 -%if 0%{?fedora} %ghost %{_unitdir}/zabbix-proxy.service -%else -%{_initrddir}/zabbix-proxy -%endif %{_mandir}/man8/zabbix_proxy.8* %files proxy-mysql %{_datadir}/%{srcname}-mysql %{_sbindir}/zabbix_proxy_mysql -%if 0%{?fedora} %{_unitdir}/zabbix-proxy-mysql.service -%endif %files proxy-pgsql %{_datadir}/%{srcname}-postgresql %{_sbindir}/zabbix_proxy_pgsql -%if 0%{?fedora} %{_unitdir}/zabbix-proxy-pgsql.service -%endif %files proxy-sqlite3 %{_datadir}/%{srcname}-sqlite3 %{_sbindir}/zabbix_proxy_sqlite3 -%if 0%{?fedora} %{_unitdir}/zabbix-proxy-sqlite3.service -%endif %files web %dir %attr(0750,apache,apache) %{_sysconfdir}/%{srcname}/web @@ -835,6 +657,11 @@ fi %files web-pgsql %changelog +* Sun Feb 16 2014 Volker Fröhlich - 2.0.11-2 +- Remove if clauses for Fedora/RHEL as they are obsolete in EL 7 +- Use systemd scriplet macros (BZ#850378) +- Remove init scripts + * Wed Feb 12 2014 Volker Fröhlich - 2.0.11-1 - New upstream release - Truncate changelog @@ -988,127 +815,3 @@ fi - upstream location (/etc) for config files is used with symlinks to the old /etc/zabbix - dropped our own SNMP trap processor, upstream one running directly under net-snmp daemon is used instead - moved zabbix_get and zabbix_sender tools to the main package - -* Thu Jun 28 2012 Dan Horák - 1.8.14-1 -- update to 1.8.14 - -* Sat May 12 2012 Dan Horák - 1.8.13-1 -- update to 1.8.13 - -* Tue Apr 24 2012 Dan Horák - 1.8.12-1 -- update to 1.8.12 - -* Wed Mar 21 2012 Dan Horák - 1.8.11-1 -- update to 1.8.11 - -* Sat Jan 14 2012 Fedora Release Engineering - 1.8.10-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - -* Wed Dec 28 2011 Dan Horák - 1.8.10-1 -- update to 1.8.10 (fixes CVE-2011-4615) - -* Thu Nov 24 2011 Dan Horák - 1.8.9-1 -- update to 1.8.9 -- switch to systemd units (#720065) -- drop empty docs subpackage -- drop spec compatibility with sysv-based systems - -* Wed Oct 5 2011 Dan Horák - 1.8.8-1 -- Update for 1.8.8 -- Drop the ZBX-4099 patch, that's now obsolete -- Remove two further htaccess files and put the configuration in - the main configuration file -- thanks to Volker Fröhlich for the changes above -- move zabbix_get to the server and proxy subpackages (#734512) -- remove prebuilt Windows binaries (#737341) -- remove flash clock applet (#737337) - -* Fri Sep 9 2011 Dan Horák - 1.8.7-2 -- fix server crash (ZBX-4099) - -* Mon Sep 5 2011 Dan Horák - 1.8.7-1 -- updated to 1.8.7 - -* Tue Aug 9 2011 Dan Horák - 1.8.6-1 -- updated to 1.8.6 (#729164, #729165) -- updated user/group adding scriptlet - -* Fri Jul 8 2011 Dan Horák - 1.8.5-5 -- rebuilt with net-snmp 5.7 - -* Mon Jun 13 2011 Dan Horák - 1.8.5-4 -- generalize the spec so creating packages like zabbix18 will be much easier - -* Fri Jun 3 2011 Dan Horák - 1.8.5-3 -- fix path to the traceroute utility -- add tmpfiles.d support for /var/run/zabbix (#656726) - -* Mon May 23 2011 Dan Horák - 1.8.5-2 -- include /var/lib/zabbix and /etc/zabbix/externalscripts dirs in package (#704181) -- add snmp trap receiver script in package (#705331) - -* Wed Apr 20 2011 Dan Horák - 1.8.5-1 -- updated to 1.8.5 - -* Wed Mar 23 2011 Dan Horák - 1.8.4-4 -- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient) - -* Tue Feb 08 2011 Fedora Release Engineering - 1.8.4-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Tue Jan 18 2011 Dan Horák - 1.8.4-2 -- enable libcurl detection (#670500) - -* Tue Jan 4 2011 Dan Horák - 1.8.4-1 -- updated to 1.8.4 -- fixes zabbix_agent fail to start on IPv4-only host (#664639) - -* Tue Nov 23 2010 Dan Horák - 1.8.3-5 -- zabbix emailer doesn't handle multiline responses (#656072) - -* Mon Nov 1 2010 Dan Horák - 1.8.3-4 -- rebuilt with net-snmp 5.6 - -* Wed Sep 29 2010 jkeating - 1.8.3-3 -- Rebuilt for gcc bug 634757 - -* Mon Sep 6 2010 Dan Horák - 1.8.3-2 -- fix font path in patch2 (#630500) - -* Tue Aug 17 2010 Dan Horák - 1.8.3-1 -- updated to 1.8.3 - -* Wed Aug 11 2010 Dan Horák - 1.8.2-3 -- added patch for XSS in triggers page (#620809, ZBX-2326) - -* Thu Apr 29 2010 Dan Horák - 1.8.2-2 -- DejaVu fonts doesn't exist on EL <= 5 - -* Tue Mar 30 2010 Dan Horák - 1.8.2-1 -- Update to 1.8.2 - -* Sat Mar 20 2010 Dan Horák - 1.8.1-7 -- web interface needs php-xml (#572413) -- updated defaults in config files (#573325) -- built with libssh2 support (#575279) - -* Wed Feb 24 2010 Dan Horák - 1.8.1-6 -- use system fonts - -* Sat Feb 13 2010 Dan Horák - 1.8.1-5 -- fixed linking with the new --no-add-needed default (#564932) - -* Mon Feb 1 2010 Dan Horák - 1.8.1-4 -- enable dependency tracking - -* Mon Feb 1 2010 Dan Horák - 1.8.1-3 -- updated the web-config patch - -* Mon Feb 1 2010 Dan Horák - 1.8.1-2 -- close fd on exec (#559221) - -* Fri Jan 29 2010 Dan Horák - 1.8.1-1 -- Update to 1.8.1 - -* Tue Jan 26 2010 Dan Horák - 1.8-1 -- Update to 1.8 From a1fa82eaeca9f41ad0735b9b5f24141d3b1770e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Tue, 3 Jun 2014 19:41:42 +0200 Subject: [PATCH 03/12] New upstream release 2.0.12 and patch for ZBX-8238 - ZBX-8238 (logrt may continue reading an old file repeatedly) --- .gitignore | 1 + sources | 2 +- zabbix-2.0.12-zbx8238.patch | 24 ++++++++++++++++++++++++ zabbix20.spec | 11 +++++++++-- 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 zabbix-2.0.12-zbx8238.patch diff --git a/.gitignore b/.gitignore index e9dd2a6..48d20b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /zabbix-2.0.11-free.tar.gz +/zabbix-2.0.12-free.tar.gz diff --git a/sources b/sources index 9ab4c4c..b9ea480 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -71dbe3737daf554daacb90933d611a07 zabbix-2.0.11-free.tar.gz +8d497bc9eca83d59ba5633645b86584e zabbix-2.0.12-free.tar.gz diff --git a/zabbix-2.0.12-zbx8238.patch b/zabbix-2.0.12-zbx8238.patch new file mode 100644 index 0000000..45eedfa --- /dev/null +++ b/zabbix-2.0.12-zbx8238.patch @@ -0,0 +1,24 @@ +diff -Nur zabbix-2.0.12/src/zabbix_agent/logfiles.c zabbix-2.0.12-logrt/src/zabbix_agent/logfiles.c +--- zabbix-2.0.12/src/zabbix_agent/logfiles.c 2014-05-13 10:37:44.000000000 +0200 ++++ zabbix-2.0.12-logrt/src/zabbix_agent/logfiles.c 2014-06-03 16:40:27.165576906 +0200 +@@ -654,6 +654,9 @@ + goto out; + } + ++ if (NULL != mtime) ++ *mtime = (int)buf.st_mtime; ++ + if ((zbx_uint64_t)buf.st_size == *lastlogsize) + { + /* The file size has not changed. Nothing to do. Here we do not deal with a case of changing */ +@@ -685,9 +688,6 @@ + *lastlogsize = l_size; + *skip_old_data = 0; + +- if (NULL != mtime) +- *mtime = (int)buf.st_mtime; +- + ret = zbx_read2(f, lastlogsize, mtime, big_rec, encoding, regexps, regexps_num, pattern, p_count, + s_count, process_value, server, port, hostname, key); + } +Binärdateien zabbix-2.0.12/src/zabbix_agent/.logfiles.c.swp und zabbix-2.0.12-logrt/src/zabbix_agent/.logfiles.c.swp sind verschieden. diff --git a/zabbix20.spec b/zabbix20.spec index 2786cb5..b16af1d 100644 --- a/zabbix20.spec +++ b/zabbix20.spec @@ -18,8 +18,8 @@ %global srcname zabbix Name: zabbix20 -Version: 2.0.11 -Release: 2%{?dist} +Version: 2.0.12 +Release: 1%{?dist} Summary: Open-source monitoring solution for your IT infrastructure Group: Applications/Internet @@ -51,6 +51,8 @@ Patch1: %{srcname}-2.0.3-fonts-config.patch Patch2: %{srcname}-2.0.1-no-flash.patch # adapt for fping3 - https://support.zabbix.com/browse/ZBX-4894 Patch3: %{srcname}-1.8.12-fping3.patch +# logrt may continue reading an old file repeatedly. +Patch4: %{srcname}-2.0.12-zbx8238.patch BuildRequires: mysql-devel BuildRequires: postgresql-devel @@ -249,6 +251,7 @@ Zabbix web frontend for PostgreSQL rm -f frontends/php/images/flash/zbxclock.swf %patch3 -p1 +%patch4 -p1 # Logrotate's su option is only available in Fedora and EL 7 sed -i '/su zabbix zabbix/d' %{SOURCE5} @@ -657,6 +660,10 @@ fi %files web-pgsql %changelog +* Tue Jun 3 2014 Volker Fröhlich - 2.0.12-1 +- New upstream release +- Patch for ZBX-8238 (logrt may continue reading an old file repeatedly) + * Sun Feb 16 2014 Volker Fröhlich - 2.0.11-2 - Remove if clauses for Fedora/RHEL as they are obsolete in EL 7 - Use systemd scriplet macros (BZ#850378) From 8cb26c0a842093206300fd0010293ecb5b54d7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Tue, 3 Jun 2014 21:16:21 +0200 Subject: [PATCH 04/12] Don't remove and correct logrotate su directive --- zabbix-logrotate.in | 4 ++-- zabbix20.spec | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/zabbix-logrotate.in b/zabbix-logrotate.in index c2f9045..84f86ae 100644 --- a/zabbix-logrotate.in +++ b/zabbix-logrotate.in @@ -3,6 +3,6 @@ monthly notifempty compress - create 0664 zabbix zabbix - su zabbix zabbix + create 0664 USER zabbix + su USER zabbix } diff --git a/zabbix20.spec b/zabbix20.spec index b16af1d..bc31cdd 100644 --- a/zabbix20.spec +++ b/zabbix20.spec @@ -19,7 +19,7 @@ Name: zabbix20 Version: 2.0.12 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Open-source monitoring solution for your IT infrastructure Group: Applications/Internet @@ -253,9 +253,6 @@ rm -f frontends/php/images/flash/zbxclock.swf %patch3 -p1 %patch4 -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 @@ -404,11 +401,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 @@ -660,6 +657,10 @@ fi %files web-pgsql %changelog +* Tue Jun 3 2014 Volker Fröhlich - 2.0.12-2 +- Don't remove su directive from logrotate config in error +- Adapt logrotate.in file and sed invocation from 2.2 packages + * Tue Jun 3 2014 Volker Fröhlich - 2.0.12-1 - New upstream release - Patch for ZBX-8238 (logrt may continue reading an old file repeatedly) From 01397837ede5a278f88831ed08228bebd622a51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Fri, 20 Jun 2014 08:34:46 +0200 Subject: [PATCH 05/12] Add patch for zbx-8158 (CVE-2014-3005) --- zabbix-2.0.12-zbx8151.patch | 53 +++++++++++++++++++++++++++++++++++++ zabbix20.spec | 9 ++++++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 zabbix-2.0.12-zbx8151.patch diff --git a/zabbix-2.0.12-zbx8151.patch b/zabbix-2.0.12-zbx8151.patch new file mode 100644 index 0000000..1ce2bac --- /dev/null +++ b/zabbix-2.0.12-zbx8151.patch @@ -0,0 +1,53 @@ +Index: frontends/php/include/defines.inc.php +=================================================================== +--- frontends/php/include/defines.inc.php (Revision 46596) ++++ frontends/php/include/defines.inc.php (Revision 46655) +@@ -835,6 +835,14 @@ + + define('ZBX_DEFAULT_IMPORT_HOST_GROUP', 'Imported hosts'); + ++// XML import flags ++// See ZBX-8151. Old version of libxml suffered from setting DTDLOAD and NOENT flags by default, which allowed ++// performing XXE attacks. Calling libxml_disable_entity_loader(true) also had no affect if flags passed to libxml ++// calls were 0 - so for better security with legacy libxml we need to call libxml_disable_entity_loader(true) AND ++// pass the LIBXML_NONET flag. Please keep in mind that LIBXML_NOENT actually EXPANDS entities, opposite to it's name - ++// so this flag is not needed here. ++define('LIBXML_IMPORT_FLAGS', LIBXML_NONET); ++ + // API errors + define('ZBX_API_ERROR_INTERNAL', 111); + define('ZBX_API_ERROR_PARAMETERS', 100); +Index: frontends/php/include/classes/import/readers/CXmlImportReader.php +=================================================================== +--- frontends/php/include/classes/import/readers/CXmlImportReader.php (Revision 46596) ++++ frontends/php/include/classes/import/readers/CXmlImportReader.php (Revision 46655) +@@ -32,7 +32,8 @@ + */ + public function read($string) { + libxml_use_internal_errors(true); +- $result = simplexml_load_string($string); ++ libxml_disable_entity_loader(true); ++ $result = simplexml_load_string($string, null, LIBXML_IMPORT_FLAGS); + if (!$result) { + $errors = libxml_get_errors(); + libxml_clear_errors(); +Index: frontends/php/include/classes/import/CXmlImport18.php +=================================================================== +--- frontends/php/include/classes/import/CXmlImport18.php (Revision 46596) ++++ frontends/php/include/classes/import/CXmlImport18.php (Revision 46655) +@@ -390,12 +390,13 @@ + return $array; + } + +- public static function import($file) { ++ public static function import($source) { + + libxml_use_internal_errors(true); ++ libxml_disable_entity_loader(true); + + $xml = new DOMDocument(); +- if (!$xml->loadXML($file)) { ++ if (!$xml->loadXML($source, LIBXML_IMPORT_FLAGS)) { + $text = ''; + foreach (libxml_get_errors() as $error) { + switch ($error->level) { diff --git a/zabbix20.spec b/zabbix20.spec index bc31cdd..f3dbb94 100644 --- a/zabbix20.spec +++ b/zabbix20.spec @@ -19,7 +19,7 @@ Name: zabbix20 Version: 2.0.12 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Open-source monitoring solution for your IT infrastructure Group: Applications/Internet @@ -53,6 +53,9 @@ Patch2: %{srcname}-2.0.1-no-flash.patch Patch3: %{srcname}-1.8.12-fping3.patch # logrt may continue reading an old file repeatedly. Patch4: %{srcname}-2.0.12-zbx8238.patch +# Local file inclusion via XXE attack (CVE-2014-3005) +# https://support.zabbix.com/browse/ZBX-8151 +Patch5: %{srcname}-2.0.12-zbx8151.patch BuildRequires: mysql-devel BuildRequires: postgresql-devel @@ -252,6 +255,7 @@ rm -f frontends/php/images/flash/zbxclock.swf %patch3 -p1 %patch4 -p1 +%patch5 -p0 # Remove bundled java libs rm -rf src/zabbix_java/lib/*.jar @@ -657,6 +661,9 @@ fi %files web-pgsql %changelog +* Fri Jun 20 2014 Volker Fröhlich - 2.0.12-3 +- Patch for ZBX-8151 (Local file inclusion via XXE attack) -- CVE-2014-3005 + * Tue Jun 3 2014 Volker Fröhlich - 2.0.12-2 - Don't remove su directive from logrotate config in error - Adapt logrotate.in file and sed invocation from 2.2 packages From d2f963dd5ca5ab76109cab97d536d034b3091040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Thu, 11 Sep 2014 10:09:10 +0200 Subject: [PATCH 06/12] Solve various systemd related problems and new version 2.0.13 --- .gitignore | 1 + sources | 2 +- zabbix-2.0.12-zbx8151.patch | 53 ----------------------------- zabbix-2.0.12-zbx8238.patch | 24 ------------- zabbix-agent.service | 4 +-- zabbix-proxy-mysql.service | 4 +-- zabbix-proxy-pgsql.service | 4 +-- zabbix-proxy-sqlite3.service | 4 +-- zabbix-server-mysql.service | 4 +-- zabbix-server-pgsql.service | 4 +-- zabbix-tmpfiles.conf | 2 +- zabbix20.spec | 66 +++++++++++++++++++++++------------- 12 files changed, 57 insertions(+), 115 deletions(-) delete mode 100644 zabbix-2.0.12-zbx8151.patch delete mode 100644 zabbix-2.0.12-zbx8238.patch diff --git a/.gitignore b/.gitignore index 48d20b5..7e28437 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /zabbix-2.0.11-free.tar.gz /zabbix-2.0.12-free.tar.gz +/zabbix-2.0.13.tar.gz diff --git a/sources b/sources index b9ea480..821c330 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -8d497bc9eca83d59ba5633645b86584e zabbix-2.0.12-free.tar.gz +538e973109c36aaa8c1f2bc7925fb1c4 zabbix-2.0.13.tar.gz diff --git a/zabbix-2.0.12-zbx8151.patch b/zabbix-2.0.12-zbx8151.patch deleted file mode 100644 index 1ce2bac..0000000 --- a/zabbix-2.0.12-zbx8151.patch +++ /dev/null @@ -1,53 +0,0 @@ -Index: frontends/php/include/defines.inc.php -=================================================================== ---- frontends/php/include/defines.inc.php (Revision 46596) -+++ frontends/php/include/defines.inc.php (Revision 46655) -@@ -835,6 +835,14 @@ - - define('ZBX_DEFAULT_IMPORT_HOST_GROUP', 'Imported hosts'); - -+// XML import flags -+// See ZBX-8151. Old version of libxml suffered from setting DTDLOAD and NOENT flags by default, which allowed -+// performing XXE attacks. Calling libxml_disable_entity_loader(true) also had no affect if flags passed to libxml -+// calls were 0 - so for better security with legacy libxml we need to call libxml_disable_entity_loader(true) AND -+// pass the LIBXML_NONET flag. Please keep in mind that LIBXML_NOENT actually EXPANDS entities, opposite to it's name - -+// so this flag is not needed here. -+define('LIBXML_IMPORT_FLAGS', LIBXML_NONET); -+ - // API errors - define('ZBX_API_ERROR_INTERNAL', 111); - define('ZBX_API_ERROR_PARAMETERS', 100); -Index: frontends/php/include/classes/import/readers/CXmlImportReader.php -=================================================================== ---- frontends/php/include/classes/import/readers/CXmlImportReader.php (Revision 46596) -+++ frontends/php/include/classes/import/readers/CXmlImportReader.php (Revision 46655) -@@ -32,7 +32,8 @@ - */ - public function read($string) { - libxml_use_internal_errors(true); -- $result = simplexml_load_string($string); -+ libxml_disable_entity_loader(true); -+ $result = simplexml_load_string($string, null, LIBXML_IMPORT_FLAGS); - if (!$result) { - $errors = libxml_get_errors(); - libxml_clear_errors(); -Index: frontends/php/include/classes/import/CXmlImport18.php -=================================================================== ---- frontends/php/include/classes/import/CXmlImport18.php (Revision 46596) -+++ frontends/php/include/classes/import/CXmlImport18.php (Revision 46655) -@@ -390,12 +390,13 @@ - return $array; - } - -- public static function import($file) { -+ public static function import($source) { - - libxml_use_internal_errors(true); -+ libxml_disable_entity_loader(true); - - $xml = new DOMDocument(); -- if (!$xml->loadXML($file)) { -+ if (!$xml->loadXML($source, LIBXML_IMPORT_FLAGS)) { - $text = ''; - foreach (libxml_get_errors() as $error) { - switch ($error->level) { diff --git a/zabbix-2.0.12-zbx8238.patch b/zabbix-2.0.12-zbx8238.patch deleted file mode 100644 index 45eedfa..0000000 --- a/zabbix-2.0.12-zbx8238.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -Nur zabbix-2.0.12/src/zabbix_agent/logfiles.c zabbix-2.0.12-logrt/src/zabbix_agent/logfiles.c ---- zabbix-2.0.12/src/zabbix_agent/logfiles.c 2014-05-13 10:37:44.000000000 +0200 -+++ zabbix-2.0.12-logrt/src/zabbix_agent/logfiles.c 2014-06-03 16:40:27.165576906 +0200 -@@ -654,6 +654,9 @@ - goto out; - } - -+ if (NULL != mtime) -+ *mtime = (int)buf.st_mtime; -+ - if ((zbx_uint64_t)buf.st_size == *lastlogsize) - { - /* The file size has not changed. Nothing to do. Here we do not deal with a case of changing */ -@@ -685,9 +688,6 @@ - *lastlogsize = l_size; - *skip_old_data = 0; - -- if (NULL != mtime) -- *mtime = (int)buf.st_mtime; -- - ret = zbx_read2(f, lastlogsize, mtime, big_rec, encoding, regexps, regexps_num, pattern, p_count, - s_count, process_value, server, port, hostname, key); - } -Binärdateien zabbix-2.0.12/src/zabbix_agent/.logfiles.c.swp und zabbix-2.0.12-logrt/src/zabbix_agent/.logfiles.c.swp sind verschieden. diff --git a/zabbix-agent.service b/zabbix-agent.service index 27bfad7..1e74b9b 100644 --- a/zabbix-agent.service +++ b/zabbix-agent.service @@ -3,10 +3,10 @@ Description=Zabbix Monitor Agent After=syslog.target network.target [Service] -Type=oneshot +Type=forking ExecStart=/usr/sbin/zabbix_agentd -RemainAfterExit=yes User=zabbix +PIDFile=/run/zabbix/zabbix_agentd.pid [Install] WantedBy=multi-user.target diff --git a/zabbix-proxy-mysql.service b/zabbix-proxy-mysql.service index 6464a5a..8f962f9 100644 --- a/zabbix-proxy-mysql.service +++ b/zabbix-proxy-mysql.service @@ -3,10 +3,10 @@ Description=Zabbix MySQL Proxy Agent After=syslog.target network.target mysqld.service [Service] -Type=oneshot +Type=forking ExecStart=/usr/sbin/zabbix_proxy -RemainAfterExit=yes User=zabbixsrv +PIDFile=/run/zabbix/zabbix_proxy.pid [Install] WantedBy=multi-user.target diff --git a/zabbix-proxy-pgsql.service b/zabbix-proxy-pgsql.service index 5d52fd9..d2bb7e4 100644 --- a/zabbix-proxy-pgsql.service +++ b/zabbix-proxy-pgsql.service @@ -3,10 +3,10 @@ Description=Zabbix PostgreSQL Proxy Agent After=syslog.target network.target postgresql.service [Service] -Type=oneshot +Type=forking ExecStart=/usr/sbin/zabbix_proxy -RemainAfterExit=yes User=zabbixsrv +PIDFile=/run/zabbix/zabbix_proxy.pid [Install] WantedBy=multi-user.target diff --git a/zabbix-proxy-sqlite3.service b/zabbix-proxy-sqlite3.service index a102fc0..5cfadfc 100644 --- a/zabbix-proxy-sqlite3.service +++ b/zabbix-proxy-sqlite3.service @@ -3,10 +3,10 @@ Description=Zabbix SQLite3 Proxy Agent After=syslog.target network.target [Service] -Type=oneshot +Type=forking ExecStart=/usr/sbin/zabbix_proxy -RemainAfterExit=yes User=zabbixsrv +PIDFile=/run/zabbix/zabbix_proxy.pid [Install] WantedBy=multi-user.target diff --git a/zabbix-server-mysql.service b/zabbix-server-mysql.service index 9c0217b..20e20b4 100644 --- a/zabbix-server-mysql.service +++ b/zabbix-server-mysql.service @@ -3,10 +3,10 @@ Description=Zabbix Server with MySQL DB After=syslog.target network.target mysqld.service [Service] -Type=oneshot +Type=forking ExecStart=/usr/sbin/zabbix_server -RemainAfterExit=yes User=zabbixsrv +PIDFile=/run/zabbix/zabbix_server.pid [Install] WantedBy=multi-user.target diff --git a/zabbix-server-pgsql.service b/zabbix-server-pgsql.service index a196b4c..8247d96 100644 --- a/zabbix-server-pgsql.service +++ b/zabbix-server-pgsql.service @@ -3,10 +3,10 @@ Description=Zabbix Server with PostgreSQL DB After=syslog.target network.target postgresql.service [Service] -Type=oneshot +Type=forking ExecStart=/usr/sbin/zabbix_server -RemainAfterExit=yes User=zabbixsrv +PIDFile=/run/zabbix/zabbix_server.pid [Install] WantedBy=multi-user.target diff --git a/zabbix-tmpfiles.conf b/zabbix-tmpfiles.conf index 3099a5d..4596c33 100644 --- a/zabbix-tmpfiles.conf +++ b/zabbix-tmpfiles.conf @@ -1 +1 @@ -D /var/run/zabbix 0775 zabbix zabbix - +D /run/zabbix 0775 zabbix zabbix - diff --git a/zabbix20.spec b/zabbix20.spec index f3dbb94..48331fe 100644 --- a/zabbix20.spec +++ b/zabbix20.spec @@ -18,16 +18,14 @@ %global srcname zabbix Name: zabbix20 -Version: 2.0.12 -Release: 3%{?dist} +Version: 2.0.13 +Release: 1%{?dist} Summary: Open-source monitoring solution for your IT infrastructure Group: Applications/Internet License: GPLv2+ URL: http://www.zabbix.com -#Source0: http://downloads.sourceforge.net/%{srcname}/%{srcname}-%{version}.tar.gz -# upstream tarball minus src/zabbix_java/lib/org-json-2010-12-28.jar -Source0: %{srcname}-%{version}-free.tar.gz +Source0: http://downloads.sourceforge.net/%{srcname}/%{srcname}-%{version}.tar.gz Source1: %{srcname}-web.conf Source5: %{srcname}-logrotate.in Source9: %{srcname}-tmpfiles.conf @@ -51,11 +49,6 @@ Patch1: %{srcname}-2.0.3-fonts-config.patch Patch2: %{srcname}-2.0.1-no-flash.patch # adapt for fping3 - https://support.zabbix.com/browse/ZBX-4894 Patch3: %{srcname}-1.8.12-fping3.patch -# logrt may continue reading an old file repeatedly. -Patch4: %{srcname}-2.0.12-zbx8238.patch -# Local file inclusion via XXE attack (CVE-2014-3005) -# https://support.zabbix.com/browse/ZBX-8151 -Patch5: %{srcname}-2.0.12-zbx8151.patch BuildRequires: mysql-devel BuildRequires: postgresql-devel @@ -99,6 +92,7 @@ multitude of servers. %package server Summary: Zabbix server common files Group: Applications/Internet +BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: %{name}-server-implementation = %{version}-%{release} Requires: fping @@ -138,7 +132,7 @@ Provides: %{name}-server-implementation = %{version}-%{release} Zabbix server compiled to use PostgresSQL %package agent -Summary: Zabbix Agent +Summary: Zabbix agent Group: Applications/Internet Requires: %{name} = %{version}-%{release} Requires(pre): shadow-utils @@ -147,11 +141,12 @@ Requires(preun): systemd Requires(postun): systemd %description agent -The Zabbix client agent, to be installed on monitored systems. +Zabbix agent, to be installed on monitored systems %package proxy -Summary: Zabbix Proxy +Summary: Zabbix proxy common files Group: Applications/Internet +BuildArch: noarch Requires: %{name} = %{version}-%{release} Requires: %{name}-proxy-implementation = %{version}-%{release} Requires(pre): shadow-utils @@ -254,8 +249,6 @@ Zabbix web frontend for PostgreSQL rm -f frontends/php/images/flash/zbxclock.swf %patch3 -p1 -%patch4 -p1 -%patch5 -p0 # Remove bundled java libs rm -rf src/zabbix_java/lib/*.jar @@ -286,7 +279,7 @@ find database -name 'data.sql' -exec sed -i 's|/usr/bin/traceroute|/bin/tracerou # Adapt configuration file options sed -i \ - -e 's|# PidFile=.*|PidFile=%{_localstatedir}/run/zabbix/zabbix_agentd.pid|g' \ + -e 's|# PidFile=.*|PidFile=/run/zabbix/zabbix_agentd.pid|g' \ -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_agentd.log|g' \ -e 's|# LogFileSize=.*|LogFileSize=0|g' \ -e 's|/usr/local||g' \ @@ -298,7 +291,7 @@ 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|# PidFile=.*|PidFile=/run/zabbix/zabbix_server.pid|g' \ -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_server.log|g' \ -e 's|# LogFileSize=.*|LogFileSize=0|g' \ -e 's|# AlertScriptsPath=${datadir}/zabbix/|AlertScriptsPath=%{_sharedstatedir}/zabbixsrv/|g' \ @@ -310,7 +303,7 @@ sed -i \ conf/zabbix_server.conf sed -i \ - -e 's|# PidFile=.*|PidFile=%{_localstatedir}/run/zabbix/zabbix_proxy.pid|g' \ + -e 's|# PidFile=.*|PidFile=/run/zabbix/zabbix_proxy.pid|g' \ -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_proxy.log|g' \ -e 's|# LogFileSize=.*|LogFileSize=0|g' \ -e 's|^DBUser=root|DBUser=zabbix|g' \ @@ -354,11 +347,13 @@ make %{?_smp_mflags} mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_sqlite3 %configure $common_flags --with-mysql --enable-server +make clean make %{?_smp_mflags} mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_mysql mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_mysql %configure $common_flags --with-postgresql --enable-server +make clean make %{?_smp_mflags} mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_pgsql mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_pgsql @@ -375,7 +370,6 @@ 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}/run/zabbix mkdir -p $RPM_BUILD_ROOT%{_unitdir} # Frontend @@ -450,9 +444,11 @@ done install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{srcname}-sqlite3 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 +# systemd tmpfiles +mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d +install -m 0644 -p %{SOURCE9} $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d/zabbix.conf +mkdir -p %{buildroot}/run +install -d -m 0755 %{buildroot}/run/zabbix/ %post server @@ -517,6 +513,9 @@ getent passwd zabbix > /dev/null || \ %pre server getent group zabbix > /dev/null || groupadd -r zabbix +getent passwd zabbix > /dev/null || \ + useradd -r -g zabbix -d %{_sharedstatedir}/zabbix -s /sbin/nologin \ + -c "Zabbix Monitoring System" zabbix getent passwd zabbixsrv > /dev/null || \ useradd -r -g zabbix -d %{_sharedstatedir}/zabbixsrv -s /sbin/nologin \ -c "Zabbix Monitoring System -- Proxy or server" zabbixsrv @@ -527,6 +526,9 @@ getent passwd zabbixsrv > /dev/null || \ %pre proxy getent group zabbix > /dev/null || groupadd -r zabbix +getent passwd zabbix > /dev/null || \ + useradd -r -g zabbix -d %{_sharedstatedir}/zabbix -s /sbin/nologin \ + -c "Zabbix Monitoring System" zabbix getent passwd zabbixsrv > /dev/null || \ useradd -r -g zabbix -d %{_sharedstatedir}/zabbixsrv -s /sbin/nologin \ -c "Zabbix Monitoring System -- Proxy or server" zabbixsrv @@ -578,8 +580,6 @@ fi %dir %{_sysconfdir}/%{srcname} %config(noreplace) %{_sysconfdir}/zabbix_agentd.conf %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_agentd.conf -#TODO: Will it complain about non-existing zabbixsrv? -%config(noreplace) %{_sysconfdir}/tmpfiles.d/zabbix.conf %{_bindir}/zabbix_get %{_bindir}/zabbix_sender %{_mandir}/man1/zabbix_get.1* @@ -587,6 +587,8 @@ fi %files server %doc misc/snmptrap/zabbix_trap_receiver.pl +%attr(0775,zabbix,zabbix) %dir /run/zabbix/ +%{_prefix}/lib/tmpfiles.d/zabbix.conf %attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix %attr(0600,zabbixsrv,zabbix) %config(noreplace) %{_sysconfdir}/zabbix_server.conf %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_server.conf @@ -610,6 +612,8 @@ fi %files agent %doc conf/zabbix_agentd/*.conf +%attr(0775,zabbix,zabbix) %dir /run/zabbix/ +%{_prefix}/lib/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 @@ -624,6 +628,8 @@ fi %files proxy %doc misc/snmptrap/zabbix_trap_receiver.pl +%attr(0775,zabbix,zabbix) %dir /run/zabbix/ +%{_prefix}/lib/tmpfiles.d/zabbix.conf %attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix %attr(0600,zabbixsrv,zabbix) %config(noreplace) %{_sysconfdir}/zabbix_proxy.conf %config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_proxy.conf @@ -661,6 +667,18 @@ fi %files web-pgsql %changelog +* Wed Sep 10 2014 Volker Fröhlich - 2.0.13-1 +- New upstream release; Remove obsolete patches for ZBX-8151 and ZBX-8238 +- Use the upstream tarball, now that non-free json was replaced with android-json +- Clean between builds, otherwise zabbix_{proxy,server} are compiled + again on install; make server and proxy package noarch now +- Set the service type to forking in unit files (BZ 1132437), + add PIDFile entry, remove RemainAfterExit, change /var/run to /run +- Install tmpfiles configuration in the proper location per guidelines, + thus solving the startup trouble due to missing directories + (respectively BZ 1115251, 1081584, 982001, 1135696) +- Harmonize package descriptions and summaries + * Fri Jun 20 2014 Volker Fröhlich - 2.0.12-3 - Patch for ZBX-8151 (Local file inclusion via XXE attack) -- CVE-2014-3005 From f44fa8fe99b623b00f63c60301fb865f6c6548dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Wed, 12 Aug 2015 00:06:04 +0200 Subject: [PATCH 07/12] New version 2.0.15 --- .gitignore | 1 + sources | 2 +- zabbix20.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7e28437..a92ad8b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /zabbix-2.0.11-free.tar.gz /zabbix-2.0.12-free.tar.gz /zabbix-2.0.13.tar.gz +/zabbix-2.0.15.tar.gz diff --git a/sources b/sources index 821c330..204a38d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -538e973109c36aaa8c1f2bc7925fb1c4 zabbix-2.0.13.tar.gz +b54893d89f2a4129124644c8a16bfae5 zabbix-2.0.15.tar.gz diff --git a/zabbix20.spec b/zabbix20.spec index 48331fe..6e29aa7 100644 --- a/zabbix20.spec +++ b/zabbix20.spec @@ -18,7 +18,7 @@ %global srcname zabbix Name: zabbix20 -Version: 2.0.13 +Version: 2.0.15 Release: 1%{?dist} Summary: Open-source monitoring solution for your IT infrastructure @@ -667,6 +667,9 @@ fi %files web-pgsql %changelog +* Tue Aug 11 2015 Volker Fröhlich - 2.0.15-1 +- New upstream release + * Wed Sep 10 2014 Volker Fröhlich - 2.0.13-1 - New upstream release; Remove obsolete patches for ZBX-8151 and ZBX-8238 - Use the upstream tarball, now that non-free json was replaced with android-json From f86f035f6858acf626c07e2d007ceb8b54fb48a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Thu, 12 Nov 2015 21:50:40 +0100 Subject: [PATCH 08/12] New version 2.0.16 --- .gitignore | 1 + sources | 2 +- zabbix20.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a92ad8b..20b1c01 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /zabbix-2.0.12-free.tar.gz /zabbix-2.0.13.tar.gz /zabbix-2.0.15.tar.gz +/zabbix-2.0.16.tar.gz diff --git a/sources b/sources index 204a38d..e7dca94 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b54893d89f2a4129124644c8a16bfae5 zabbix-2.0.15.tar.gz +1fec38a1fa72b5548a5875ac04c2294d zabbix-2.0.16.tar.gz diff --git a/zabbix20.spec b/zabbix20.spec index 6e29aa7..6d5455e 100644 --- a/zabbix20.spec +++ b/zabbix20.spec @@ -18,7 +18,7 @@ %global srcname zabbix Name: zabbix20 -Version: 2.0.15 +Version: 2.0.16 Release: 1%{?dist} Summary: Open-source monitoring solution for your IT infrastructure @@ -667,6 +667,9 @@ fi %files web-pgsql %changelog +* Thu Nov 12 2015 Volker Fröhlich - 2.0.16-1 +- New upstream release + * Tue Aug 11 2015 Volker Fröhlich - 2.0.15-1 - New upstream release From ab152def886f3e7c5873f5f19c3de3d9a10b5a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Sat, 8 Oct 2016 10:23:53 +0200 Subject: [PATCH 09/12] New version 2.0.19 --- .gitignore | 1 + sources | 2 +- zabbix20.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 20b1c01..da1e2e0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /zabbix-2.0.13.tar.gz /zabbix-2.0.15.tar.gz /zabbix-2.0.16.tar.gz +/zabbix-2.0.19.tar.gz diff --git a/sources b/sources index e7dca94..2975327 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1fec38a1fa72b5548a5875ac04c2294d zabbix-2.0.16.tar.gz +e0f6cfa9c1749be48fc7587f549e6904 zabbix-2.0.19.tar.gz diff --git a/zabbix20.spec b/zabbix20.spec index 6d5455e..74071f8 100644 --- a/zabbix20.spec +++ b/zabbix20.spec @@ -18,7 +18,7 @@ %global srcname zabbix Name: zabbix20 -Version: 2.0.16 +Version: 2.0.19 Release: 1%{?dist} Summary: Open-source monitoring solution for your IT infrastructure @@ -667,6 +667,9 @@ fi %files web-pgsql %changelog +* Sat Oct 08 2016 Volker Fröhlich - 2.0.19-1 +- New upstream release + * Thu Nov 12 2015 Volker Fröhlich - 2.0.16-1 - New upstream release From 81288194c6abaaec8f187be919b16bb390a891de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Sun, 11 Dec 2016 12:51:08 +0100 Subject: [PATCH 10/12] New version 2.0.20 --- .gitignore | 1 + sources | 2 +- zabbix20.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index da1e2e0..583ae56 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /zabbix-2.0.15.tar.gz /zabbix-2.0.16.tar.gz /zabbix-2.0.19.tar.gz +/zabbix-2.0.20.tar.gz diff --git a/sources b/sources index 2975327..bddb320 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e0f6cfa9c1749be48fc7587f549e6904 zabbix-2.0.19.tar.gz +2e5040ff48f3517956ee78c344ff83eb zabbix-2.0.20.tar.gz diff --git a/zabbix20.spec b/zabbix20.spec index 74071f8..a30a5bb 100644 --- a/zabbix20.spec +++ b/zabbix20.spec @@ -18,7 +18,7 @@ %global srcname zabbix Name: zabbix20 -Version: 2.0.19 +Version: 2.0.20 Release: 1%{?dist} Summary: Open-source monitoring solution for your IT infrastructure @@ -667,6 +667,9 @@ fi %files web-pgsql %changelog +* Sun Dec 11 2016 Volker Fröhlich - 2.0.20-1 +- New upstream release + * Sat Oct 08 2016 Volker Fröhlich - 2.0.19-1 - New upstream release From 175bd9ba73ef3cd68c98ddf397492ec019533847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volker=20Fr=C3=B6hlich?= Date: Fri, 23 Jun 2017 22:18:33 +0200 Subject: [PATCH 11/12] New and final version of the 2.0 series: 2.0.21 http://www.zabbix.com/life_cycle_and_release_policy --- .gitignore | 1 + sources | 2 +- zabbix20.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 583ae56..54491f4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /zabbix-2.0.16.tar.gz /zabbix-2.0.19.tar.gz /zabbix-2.0.20.tar.gz +/zabbix-2.0.21.tar.gz diff --git a/sources b/sources index bddb320..0371759 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2e5040ff48f3517956ee78c344ff83eb zabbix-2.0.20.tar.gz +SHA512 (zabbix-2.0.21.tar.gz) = 566f9ea6e6a4ed51941a0858311ded43b2d68d68a6a2a2a61824413008e0806df1b9747365df29b652a530be8e1cd68405bb7c65e86197ebe778bd4608127754 diff --git a/zabbix20.spec b/zabbix20.spec index a30a5bb..5b50d4f 100644 --- a/zabbix20.spec +++ b/zabbix20.spec @@ -18,7 +18,7 @@ %global srcname zabbix Name: zabbix20 -Version: 2.0.20 +Version: 2.0.21 Release: 1%{?dist} Summary: Open-source monitoring solution for your IT infrastructure @@ -667,6 +667,9 @@ fi %files web-pgsql %changelog +* Fri Jun 23 2017 Volker Fröhlich - 2.0.21-1 +- New upstream release + * Sun Dec 11 2016 Volker Fröhlich - 2.0.20-1 - New upstream release From 5c100906eb08831cdddc09de35ea0ab9259d23dc Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 31 Oct 2018 15:14:22 -0600 Subject: [PATCH 12/12] 2.0 is out of support and has broken deps, move to 2.2, 3.0, or later --- .gitignore | 8 - dead.package | 1 + sources | 1 - zabbix-1.8.12-fping3.patch | 39 -- zabbix-2.0.1-no-flash.patch | 11 - zabbix-2.0.2-config.patch | 22 - zabbix-2.0.3-fonts-config.patch | 12 - zabbix-agent.service | 12 - zabbix-fedora.README | 174 ------- zabbix-logrotate.in | 8 - zabbix-proxy-mysql.service | 12 - zabbix-proxy-pgsql.service | 12 - zabbix-proxy-sqlite3.service | 12 - zabbix-server-mysql.service | 12 - zabbix-server-pgsql.service | 12 - zabbix-tmpfiles.conf | 1 - zabbix-web.conf | 48 -- zabbix20.spec | 865 -------------------------------- 18 files changed, 1 insertion(+), 1261 deletions(-) delete mode 100644 .gitignore create mode 100644 dead.package delete mode 100644 sources delete mode 100644 zabbix-1.8.12-fping3.patch delete mode 100644 zabbix-2.0.1-no-flash.patch delete mode 100644 zabbix-2.0.2-config.patch delete mode 100644 zabbix-2.0.3-fonts-config.patch delete mode 100644 zabbix-agent.service delete mode 100644 zabbix-fedora.README delete mode 100644 zabbix-logrotate.in delete mode 100644 zabbix-proxy-mysql.service delete mode 100644 zabbix-proxy-pgsql.service delete mode 100644 zabbix-proxy-sqlite3.service delete mode 100644 zabbix-server-mysql.service delete mode 100644 zabbix-server-pgsql.service delete mode 100644 zabbix-tmpfiles.conf delete mode 100644 zabbix-web.conf delete mode 100644 zabbix20.spec diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 54491f4..0000000 --- a/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/zabbix-2.0.11-free.tar.gz -/zabbix-2.0.12-free.tar.gz -/zabbix-2.0.13.tar.gz -/zabbix-2.0.15.tar.gz -/zabbix-2.0.16.tar.gz -/zabbix-2.0.19.tar.gz -/zabbix-2.0.20.tar.gz -/zabbix-2.0.21.tar.gz diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..efb9685 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +2.0 is out of support and has broken deps, move to 2.2, 3.0, or later diff --git a/sources b/sources deleted file mode 100644 index 0371759..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -SHA512 (zabbix-2.0.21.tar.gz) = 566f9ea6e6a4ed51941a0858311ded43b2d68d68a6a2a2a61824413008e0806df1b9747365df29b652a530be8e1cd68405bb7c65e86197ebe778bd4608127754 diff --git a/zabbix-1.8.12-fping3.patch b/zabbix-1.8.12-fping3.patch deleted file mode 100644 index db8c456..0000000 --- a/zabbix-1.8.12-fping3.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff -up zabbix-1.8.12/src/libs/zbxicmpping/icmpping.c.fping3 zabbix-1.8.12/src/libs/zbxicmpping/icmpping.c ---- zabbix-1.8.12/src/libs/zbxicmpping/icmpping.c.fping3 2012-04-24 16:31:36.000000000 +0200 -+++ zabbix-1.8.12/src/libs/zbxicmpping/icmpping.c 2012-04-24 16:32:31.000000000 +0200 -@@ -42,34 +42,7 @@ static const char *source_ip6_option = N - - static void get_source_ip_option(const char *fping, const char **option, unsigned char *checked) - { -- FILE *f; -- char *p, tmp[MAX_STRING_LEN]; -- -- zbx_snprintf(tmp, sizeof(tmp), "%s -h 2>&1", fping); -- -- if (NULL == (f = popen(tmp, "r"))) -- return; -- -- while (NULL != fgets(tmp, sizeof(tmp), f)) -- { -- for (p = tmp; isspace(*p); p++) -- ; -- -- if ('-' == p[0] && 'I' == p[1] && isspace(p[2])) -- { -- *option = "-I"; -- break; -- } -- -- if ('-' == p[0] && 'S' == p[1] && isspace(p[2])) -- { -- *option = "-S"; -- break; -- } -- } -- -- pclose(f); -- -+ *option = "-S"; - *checked = 1; - } - diff --git a/zabbix-2.0.1-no-flash.patch b/zabbix-2.0.1-no-flash.patch deleted file mode 100644 index 36a7824..0000000 --- a/zabbix-2.0.1-no-flash.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up zabbix-2.0.1/frontends/php/include/screens.inc.php.orig zabbix-2.0.1/frontends/php/include/screens.inc.php ---- zabbix-2.0.1/frontends/php/include/screens.inc.php.orig 2012-06-27 23:03:03.000000000 +0200 -+++ zabbix-2.0.1/frontends/php/include/screens.inc.php 2012-07-12 16:29:02.000000000 +0200 -@@ -25,7 +25,6 @@ require_once dirname(__FILE__).'/js.inc. - - function screen_resources($resource = null) { - $resources = array( -- SCREEN_RESOURCE_CLOCK => _('Clock'), - SCREEN_RESOURCE_DATA_OVERVIEW => _('Data overview'), - SCREEN_RESOURCE_GRAPH => _('Graph'), - SCREEN_RESOURCE_ACTIONS => _('History of actions'), diff --git a/zabbix-2.0.2-config.patch b/zabbix-2.0.2-config.patch deleted file mode 100644 index c25238b..0000000 --- a/zabbix-2.0.2-config.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -Nur zabbix-2.0.2/frontends/php/include/config.inc.php zabbix-2.0.2-conf/frontends/php/include/config.inc.php ---- zabbix-2.0.2/frontends/php/include/config.inc.php 2012-07-31 11:16:47.000000000 +0200 -+++ zabbix-2.0.2-conf/frontends/php/include/config.inc.php 2012-09-04 00:07:03.217816413 +0200 -@@ -31,7 +31,7 @@ - CProfiler::getInstance()->start(); - - require_once dirname(__FILE__).'/profiles.inc.php'; --require_once dirname(__FILE__).'/../conf/maintenance.inc.php'; -+require_once '/etc/zabbix/web/maintenance.inc.php'; - - // abc sorting - require_once dirname(__FILE__).'/acknow.inc.php'; -@@ -64,8 +64,7 @@ - $USER_RIGHTS = array(); - $ZBX_LOCALNODEID = 0; - $ZBX_LOCMASTERID = 0; --$ZBX_CONFIGURATION_FILE = './conf/zabbix.conf.php'; --$ZBX_CONFIGURATION_FILE = realpath(dirname($ZBX_CONFIGURATION_FILE)).DIRECTORY_SEPARATOR.basename($ZBX_CONFIGURATION_FILE); -+$ZBX_CONFIGURATION_FILE = '/etc/zabbix/web/zabbix.conf.php'; - - // include tactical overview modules - require_once dirname(__FILE__).'/locales.inc.php'; diff --git a/zabbix-2.0.3-fonts-config.patch b/zabbix-2.0.3-fonts-config.patch deleted file mode 100644 index 02dd5e5..0000000 --- a/zabbix-2.0.3-fonts-config.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur zabbix-2.0.3/frontends/php/include/defines.inc.php zabbix-2.0.3-fonts/frontends/php/include/defines.inc.php ---- zabbix-2.0.3/frontends/php/include/defines.inc.php 2012-10-03 16:41:36.000000000 +0200 -+++ zabbix-2.0.3-fonts/frontends/php/include/defines.inc.php 2012-10-05 23:47:17.341790748 +0200 -@@ -34,7 +34,7 @@ - - define('ZBX_WIDGET_ROWS', 20); - --define('ZBX_FONTPATH', realpath('fonts')); // where to search for font (GD > 2.0.18) -+define('ZBX_FONTPATH', '/usr/share/fonts/dejavu'); // where to search for font (GD > 2.0.18) - define('ZBX_GRAPH_FONT_NAME', 'DejaVuSans'); // font file name - define('ZBX_GRAPH_LEGEND_HEIGHT', 120); // when graph height is less then this value, some legend will not show up - diff --git a/zabbix-agent.service b/zabbix-agent.service deleted file mode 100644 index 1e74b9b..0000000 --- a/zabbix-agent.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Zabbix Monitor Agent -After=syslog.target network.target - -[Service] -Type=forking -ExecStart=/usr/sbin/zabbix_agentd -User=zabbix -PIDFile=/run/zabbix/zabbix_agentd.pid - -[Install] -WantedBy=multi-user.target diff --git a/zabbix-fedora.README b/zabbix-fedora.README deleted file mode 100644 index 3a6f35e..0000000 --- a/zabbix-fedora.README +++ /dev/null @@ -1,174 +0,0 @@ -=Custom in Fedora/EPEL= - -==Pinger files== - -Since /tmp is not a good place to spool files, the pinger files shall now reside -in /var/lib/zabbixsrv/tmp. This directory is automatically created and proxy and -server configuration files are changed accordingly from 2.0.8 on. - - -==Web configuration== - -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. - - -==Where's my Flash watch?== - -It's not included in Fedora! Fedora's policy does not allow to include blobs: -https://support.zabbix.com/browse/ZBX-4794 - - -==No htaccess files== - -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== - -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 -for proxy and server. Please check the permissions of your scripts and group -memberships, if necessary. - - -==Using the Alternatives system instead of conflicting sub-packages== - -You can now install Zabbix proxies or servers compiled for different database -back-ends on the same system. While this is not intended to happily switch back -and forth, it allows you to: - -- Stop the daemon -- "Run alternatives --config zabbix-server" or - "alternatives --config zabbix-proxy" -- Make your choice -- If you're using systemd, run systemctl reload -- Adjust the configuration file -- Start the daemon -- In some cases you have to use "restart" instead of "start". - The reason is not yet clear to me. - -"Alternatives" considers the first installed implementation of server or proxy as -default, respectively. - -Don't forget to reconfigure the front-end when you switch the server to a -different DB implementation! - - -==How to run multiple instances of a Zabbix daemon with init scripts== - -If you want to run multiple instances on the same host, do the following: - -- Copy the init scripts -- Create a file of the same name as the new init script in /etc/sysconfig -- Define CFG_FILE="" in this file -- Create the file defined as CFG_FILE and adjust settings; in particular: - - DB settings if you set up multiple instances of server and proxy daemons; - IMPORTANT: Two daemons using the same database at the same time could act - destructive! - - PidFile - - ListenPort and/or ListenIP, if you plan for simultaneous operation; - Don't forget to review your firewall settings! - - LogFile, if you don't use syslog -- Optionally run the following to register the new instance as a service and - start it up automatically: - chkconfig --add - chkconfig on -- service start - - -==Configuration changes== - -Zabbix 2.0 places configuration files directly in /etc. Symlinks preserve -compatibility. maintenance.inc.php moved from /usr/share/zabbix/conf to -/etc/zabbix/web. - - -==Media scripts and external scripts== - -The directories for external scripts and media scripts have moved to -/var/lib/zabbixsrv. Symlinks preserve compatibility. - -/var/lib/zabbix is now intended for scripts run by the agent. Please move your -server or proxy scripts to /var/lib/zabbixsrv. Be sure to check permissions and -ownership. - - -==No Java bridge== - -The Zabbix Java bridge can not be included now, due to legal issue with one of -the modules (json). See https://support.zabbix.com/browse/ZBX-4800 and feel free -to vote on it. - - -==No SQLite front-end or server implementation== - -Sadly it doesn't work with how Fedora's/EPEL's PHP is compiled. - --------------------------------------------------------------------------------- - -=SELinux= - -The settings necessary for you vary, depending on how you set up your system/s. -Most of the time, the only adjustments necessary should be on the machine that -holds the frontend: - -#Allow to connect the frontend to a database by other means than sockets -setsebool -P httpd_can_network_connect_db 1 - -#Allow the frontend to create a connection to the server listening port -#That's the check the frontend uses to see whether the server is running. -#This option effectively supersedes the previous -setsebool -P httpd_can_network_connect 1 - -Using sebools is a somewhat coarse method of allowing things. -A more fine-grained approach for the latter would be to grab an actual -avc denial from the audit log, pipe it through audit2allow, put it in a -module package and load that: - -echo "avc: denied { name_connect } for pid=20619 comm="httpd" dest=10051 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:zabbix_port_t:s0 tclass=tcp_socket" | audit2allow -M zabbix_conn_httpd; sudo semodule -i zabbix_conn_httpd.pp - -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 - --------------------------------------------------------------------------------- - -=Guide for upgrading to 2.0 from 1.8= - -http://www.zabbix.com/documentation/2.0/manual/installation/upgrade==notes - -The below should be the relevant steps, picked from -http://www.zabbix.com/documentation/2.0/manual/installation/upgrade - -- Review all rpmnew and rpmsave files; merge where necessary -- Review permissions, ownerships and group memberships for zabbixsrv -- 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, ...) -- Run the fitting database update script/s -- The scripts can run very long, depending on the content of your database and - your hardware; -- Check the output of the script for errors - -Volker Fröhlich volker27@gmx.at Jan 3 2013 diff --git a/zabbix-logrotate.in b/zabbix-logrotate.in deleted file mode 100644 index 84f86ae..0000000 --- a/zabbix-logrotate.in +++ /dev/null @@ -1,8 +0,0 @@ -/var/log/zabbix/zabbix_COMPONENT.log { - missingok - monthly - notifempty - compress - create 0664 USER zabbix - su USER zabbix -} diff --git a/zabbix-proxy-mysql.service b/zabbix-proxy-mysql.service deleted file mode 100644 index 8f962f9..0000000 --- a/zabbix-proxy-mysql.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Zabbix MySQL Proxy Agent -After=syslog.target network.target mysqld.service - -[Service] -Type=forking -ExecStart=/usr/sbin/zabbix_proxy -User=zabbixsrv -PIDFile=/run/zabbix/zabbix_proxy.pid - -[Install] -WantedBy=multi-user.target diff --git a/zabbix-proxy-pgsql.service b/zabbix-proxy-pgsql.service deleted file mode 100644 index d2bb7e4..0000000 --- a/zabbix-proxy-pgsql.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Zabbix PostgreSQL Proxy Agent -After=syslog.target network.target postgresql.service - -[Service] -Type=forking -ExecStart=/usr/sbin/zabbix_proxy -User=zabbixsrv -PIDFile=/run/zabbix/zabbix_proxy.pid - -[Install] -WantedBy=multi-user.target diff --git a/zabbix-proxy-sqlite3.service b/zabbix-proxy-sqlite3.service deleted file mode 100644 index 5cfadfc..0000000 --- a/zabbix-proxy-sqlite3.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Zabbix SQLite3 Proxy Agent -After=syslog.target network.target - -[Service] -Type=forking -ExecStart=/usr/sbin/zabbix_proxy -User=zabbixsrv -PIDFile=/run/zabbix/zabbix_proxy.pid - -[Install] -WantedBy=multi-user.target diff --git a/zabbix-server-mysql.service b/zabbix-server-mysql.service deleted file mode 100644 index 20e20b4..0000000 --- a/zabbix-server-mysql.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Zabbix Server with MySQL DB -After=syslog.target network.target mysqld.service - -[Service] -Type=forking -ExecStart=/usr/sbin/zabbix_server -User=zabbixsrv -PIDFile=/run/zabbix/zabbix_server.pid - -[Install] -WantedBy=multi-user.target diff --git a/zabbix-server-pgsql.service b/zabbix-server-pgsql.service deleted file mode 100644 index 8247d96..0000000 --- a/zabbix-server-pgsql.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Zabbix Server with PostgreSQL DB -After=syslog.target network.target postgresql.service - -[Service] -Type=forking -ExecStart=/usr/sbin/zabbix_server -User=zabbixsrv -PIDFile=/run/zabbix/zabbix_server.pid - -[Install] -WantedBy=multi-user.target diff --git a/zabbix-tmpfiles.conf b/zabbix-tmpfiles.conf deleted file mode 100644 index 4596c33..0000000 --- a/zabbix-tmpfiles.conf +++ /dev/null @@ -1 +0,0 @@ -D /run/zabbix 0775 zabbix zabbix - diff --git a/zabbix-web.conf b/zabbix-web.conf deleted file mode 100644 index 4e4e237..0000000 --- a/zabbix-web.conf +++ /dev/null @@ -1,48 +0,0 @@ -# -# Zabbix monitoring system php web frontend -# - -Alias /zabbix /usr/share/zabbix - - - Options FollowSymLinks - AllowOverride None - - - # Apache 2.4 - Require all granted - - - - # Apache 2.2 - Order allow,deny - Allow from all - - - - - - - # Apache 2.4 - Require all denied - - - - # Apache 2.2 - Order deny,allow - Deny from all - - - - - # Apache 2.4 - Require all denied - - - - Order deny,allow - Deny from all - - - - diff --git a/zabbix20.spec b/zabbix20.spec deleted file mode 100644 index 5b50d4f..0000000 --- a/zabbix20.spec +++ /dev/null @@ -1,865 +0,0 @@ -# TODO, maybe sometime: -# * 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? -# "Include" statement in config files needs patching in order to not load -# various backup files (*.rpm{orig,new,save}, *~ etc) in that dir. -# https://support.zabbix.com/browse/ZBXNEXT-497 -# * Consider using systemd's ReadWriteDirectories - -#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: zabbix20 -Version: 2.0.21 -Release: 1%{?dist} -Summary: Open-source monitoring solution for your IT infrastructure - -Group: Applications/Internet -License: GPLv2+ -URL: http://www.zabbix.com -Source0: http://downloads.sourceforge.net/%{srcname}/%{srcname}-%{version}.tar.gz -Source1: %{srcname}-web.conf -Source5: %{srcname}-logrotate.in -Source9: %{srcname}-tmpfiles.conf -# systemd units -- Alternatives switches between them (they state their dependencies) -# https://support.zabbix.com/browse/ZBXNEXT-1593 -Source10: %{srcname}-agent.service -Source11: %{srcname}-proxy-mysql.service -Source12: %{srcname}-proxy-pgsql.service -Source13: %{srcname}-proxy-sqlite3.service -Source14: %{srcname}-server-mysql.service -Source15: %{srcname}-server-pgsql.service - -Source16: %{srcname}-fedora.README - -# local rules for config files -Patch0: %{srcname}-2.0.2-config.patch -# local rules for config files - fonts -Patch1: %{srcname}-2.0.3-fonts-config.patch -# remove flash content (#737337) -# https://support.zabbix.com/browse/ZBX-4794 -Patch2: %{srcname}-2.0.1-no-flash.patch -# adapt for fping3 - https://support.zabbix.com/browse/ZBX-4894 -Patch3: %{srcname}-1.8.12-fping3.patch - -BuildRequires: mysql-devel -BuildRequires: postgresql-devel -BuildRequires: sqlite-devel -BuildRequires: net-snmp-devel -BuildRequires: openldap-devel -BuildRequires: gnutls-devel -BuildRequires: iksemel-devel -BuildRequires: unixODBC-devel -BuildRequires: curl-devel -BuildRequires: OpenIPMI-devel -BuildRequires: libssh2-devel -BuildRequires: systemd - -Requires: logrotate -# Could alternatively be conditional on Fedora/EL -%if %{srcname} != %{name} -Conflicts: %{srcname} -%else -Obsoletes: %{srcname}-docs < 1.8.15-2 -Obsoletes: %{srcname}-web-sqlite3 < 2.0.3-3 -Obsoletes: %{srcname}-server-sqlite3 < 2.0.3-3 -%endif - -%description -Zabbix is software that monitors numerous parameters of a network and the -health and integrity of servers. Zabbix uses a flexible notification mechanism -that allows users to configure e-mail based alerts for virtually any event. -This allows a fast reaction to server problems. Zabbix offers excellent -reporting and data visualization features based on the stored data. -This makes Zabbix ideal for capacity planning. - -Zabbix supports both polling and trapping. All Zabbix reports and statistics, -as well as configuration parameters are accessed through a web-based front end. -A web-based front end ensures that the status of your network and the health of -your servers can be assessed from any location. Properly configured, Zabbix can -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 server -Summary: Zabbix server common files -Group: Applications/Internet -BuildArch: noarch -Requires: %{name} = %{version}-%{release} -Requires: %{name}-server-implementation = %{version}-%{release} -Requires: fping -Requires: traceroute -Requires(pre): shadow-utils -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd - -%description server -Zabbix server common files - -%package server-mysql -Summary: Zabbix server compiled to use MySQL -Group: Applications/Internet -Requires: %{name} = %{version}-%{release} -Requires: %{name}-server = %{version}-%{release} -Requires(post): %{_sbindir}/update-alternatives -Requires(preun): %{_sbindir}/alternatives -Requires(postun): %{_sbindir}/update-alternatives -Provides: %{name}-server-implementation = %{version}-%{release} - -%description server-mysql -Zabbix server compiled to use MySQL - -%package server-pgsql -Summary: Zabbix server compiled to use PostgresSQL -Group: Applications/Internet -Requires: %{name} = %{version}-%{release} -Requires: %{name}-server = %{version}-%{release} -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 - -%package agent -Summary: Zabbix agent -Group: Applications/Internet -Requires: %{name} = %{version}-%{release} -Requires(pre): shadow-utils -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd - -%description agent -Zabbix agent, to be installed on monitored systems - -%package proxy -Summary: Zabbix proxy common files -Group: Applications/Internet -BuildArch: noarch -Requires: %{name} = %{version}-%{release} -Requires: %{name}-proxy-implementation = %{version}-%{release} -Requires(pre): shadow-utils -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd -Requires: fping - -%description proxy -The Zabbix proxy - -%package proxy-mysql -Summary: Zabbix proxy compiled to use MySQL -Group: Applications/Internet -Requires: %{name}-proxy = %{version}-%{release} -Provides: %{name}-proxy-implementation = %{version}-%{release} -Requires(post): %{_sbindir}/update-alternatives -Requires(preun): %{_sbindir}/alternatives -Requires(postun): %{_sbindir}/update-alternatives - -%description proxy-mysql -The Zabbix proxy compiled to use MySQL - -%package proxy-pgsql -Summary: Zabbix proxy compiled to use PostgreSQL -Group: Applications/Internet -Requires: %{name}-proxy = %{version}-%{release} -Provides: %{name}-proxy-implementation = %{version}-%{release} -Requires(post): %{_sbindir}/update-alternatives -Requires(preun): %{_sbindir}/alternatives -Requires(postun): %{_sbindir}/update-alternatives - -%description proxy-pgsql -The Zabbix proxy compiled to use PostgreSQL - -%package proxy-sqlite3 -Summary: Zabbix proxy compiled to use SQLite -Group: Applications/Internet -Requires: %{name}-proxy = %{version}-%{release} -Provides: %{name}-proxy-implementation = %{version}-%{release} -Requires(post): %{_sbindir}/update-alternatives -Requires(preun): %{_sbindir}/alternatives -Requires(postun): %{_sbindir}/update-alternatives - -%description proxy-sqlite3 -The Zabbix proxy compiled to use SQLite - -%package web -Summary: Zabbix Web Frontend -Group: Applications/Internet -BuildArch: noarch -# Don't remove "php". Everything else only depends on php-common -# and you'll end up with no module for Apache! -Requires: php -Requires: php-gd -Requires: php-bcmath -Requires: php-ldap -Requires: php-mbstring -Requires: php-xml -Requires: php-gettext -Requires: dejavu-sans-fonts -Requires: %{name} = %{version}-%{release} -Requires: %{name}-web-database = %{version}-%{release} - -%description web -The php frontend to display the Zabbix web interface. - -%package web-mysql -Summary: Zabbix web frontend for MySQL -Group: Applications/Internet -BuildArch: noarch -Requires: %{name}-web = %{version}-%{release} -Requires: php-mysql -Provides: %{name}-web-database = %{version}-%{release} -Obsoletes: %{name}-web <= 1.5.3-0.1 - -%description web-mysql -Zabbix web frontend for MySQL - -%package web-pgsql -Summary: Zabbix web frontend for PostgreSQL -Group: Applications/Internet -BuildArch: noarch -Requires: %{name}-web = %{version}-%{release} -Requires: php-pgsql -Provides: %{name}-web-database = %{version}-%{release} - -%description web-pgsql -Zabbix web frontend for PostgreSQL - - -%prep -%setup0 -q -n %{srcname}-%{version} -%patch0 -p1 -%patch1 -p1 - -# Remove flash applet -# https://support.zabbix.com/browse/ZBX-4794 -%patch2 -p1 -rm -f frontends/php/images/flash/zbxclock.swf - -%patch3 -p1 - -# Remove bundled java libs -rm -rf src/zabbix_java/lib/*.jar - -# Remove prebuilt Windows binaries -rm -rf bin - -# Remove included fonts -rm -rf frontends/php/fonts - -# Remove executable permissions -chmod a-x upgrades/dbpatches/*/mysql/upgrade - -# Override statically named directory for alertscripts and externalscripts -# https://support.zabbix.com/browse/ZBX-6159 -sed -i 's|$(DESTDIR)@datadir@/zabbix|$(DESTDIR)/var/lib/zabbixsrv|' \ - src/zabbix_server/Makefile.in \ - src/zabbix_proxy/Makefile.in - -# Kill off .htaccess files, options set in SOURCE1 -rm -f frontends/php/include/.htaccess -rm -f frontends/php/api/.htaccess -rm -f frontends/php/conf/.htaccess - -# Fix path to traceroute utility -# Still valid for EL7! -find database -name 'data.sql' -exec sed -i 's|/usr/bin/traceroute|/bin/traceroute|' {} \; - -# Adapt configuration file options -sed -i \ - -e 's|# PidFile=.*|PidFile=/run/zabbix/zabbix_agentd.pid|g' \ - -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_agentd.log|g' \ - -e 's|# LogFileSize=.*|LogFileSize=0|g' \ - -e 's|/usr/local||g' \ - conf/zabbix_agentd.conf - -sed -i \ - -e 's|/usr/local||g' \ - conf/zabbix_agent.conf - -#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=/run/zabbix/zabbix_server.pid|g' \ - -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/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' \ - -e 's|# DBSocket=/tmp/mysql.sock|DBSocket=%{_sharedstatedir}/mysql/mysql.sock|g' \ - -e 's|# ExternalScripts=\${datadir}/zabbix/externalscripts|ExternalScripts=%{_sharedstatedir}/zabbixsrv/externalscripts|' \ - -e 's|# TmpDir=\/tmp|TmpDir=%{_sharedstatedir}/zabbixsrv/tmp|' \ - -e 's|/usr/local||g' \ - conf/zabbix_server.conf - -sed -i \ - -e 's|# PidFile=.*|PidFile=/run/zabbix/zabbix_proxy.pid|g' \ - -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/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' \ - -e 's|# ExternalScripts=\${datadir}/zabbix/externalscripts|ExternalScripts=%{_sharedstatedir}/zabbixsrv/externalscripts|' \ - -e 's|# TmpDir=\/tmp|TmpDir=%{_sharedstatedir}/zabbixsrv/tmp|' \ - -e 's|/usr/local||g' \ - conf/zabbix_proxy.conf - -#TODO: Ticket -# Adapt man pages and SQL patches -sed -i 's|/usr/local||g;s| (if not modified during compile time).||' man/*.man -sed -i 's|/usr/local||g' \ - upgrades/dbpatches/2.0/mysql/patch.sql \ - upgrades/dbpatches/2.0/postgresql/patch.sql - -# Install README file -install -m0644 %{SOURCE16} . - - -%build - -common_flags=" - --enable-dependency-tracking - --enable-agent - --enable-proxy - --enable-ipv6 - --disable-java - --with-net-snmp - --with-ldap - --with-libcurl - --with-openipmi - --with-jabber - --with-unixodbc - --with-ssh2 -" - -# Frontend doesn't work for SQLite, thus don't build server -%configure $common_flags --with-sqlite3 -make %{?_smp_mflags} -mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_sqlite3 - -%configure $common_flags --with-mysql --enable-server -make clean -make %{?_smp_mflags} -mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_mysql -mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_mysql - -%configure $common_flags --with-postgresql --enable-server -make clean -make %{?_smp_mflags} -mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_pgsql -mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_pgsql - -# Ghosted alternatives -touch src/zabbix_server/zabbix_server -touch src/zabbix_proxy/zabbix_proxy - - -%install -# Configuration, runtime and start-up -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname} -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%{_unitdir} - -# Frontend -mkdir -p $RPM_BUILD_ROOT%{_datadir} - -# Home directory for the agent; -# The other home directory is created during installation -mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/zabbix - -# Install binaries -make DESTDIR=$RPM_BUILD_ROOT install -install -m 0755 -p src/zabbix_server/zabbix_server_* $RPM_BUILD_ROOT%{_sbindir}/ -install -m 0755 -p src/zabbix_proxy/zabbix_proxy_* $RPM_BUILD_ROOT%{_sbindir}/ - -# Install the frontend after removing backup files from patching -find frontends/php -name '*.orig' -exec rm {} \; -cp -a frontends/php $RPM_BUILD_ROOT%{_datadir}/%{srcname} - -# Prepare ghosted config file -#TODO: Simplify that? Like /etc/zabbix_web/zabbix.conf.php? -touch $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/web/zabbix.conf.php - -# This file is used to switch the frontend to maintenance mode -mv $RPM_BUILD_ROOT%{_datadir}/%{srcname}/conf/maintenance.inc.php $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/web/maintenance.inc.php - -# Drop Apache config file in place -install -m 0644 -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{srcname}.conf - -# Install log rotation -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; s|USER|zabbixsrv|g' %{SOURCE5} > \ - $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-server -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 -install -m 0644 -p %{SOURCE10} $RPM_BUILD_ROOT%{_unitdir}/zabbix-agent.service -install -m 0644 -p %{SOURCE11} $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy-mysql.service -install -m 0644 -p %{SOURCE12} $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy-pgsql.service -install -m 0644 -p %{SOURCE13} $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy-sqlite3.service -install -m 0644 -p %{SOURCE14} $RPM_BUILD_ROOT%{_unitdir}/zabbix-server-mysql.service -install -m 0644 -p %{SOURCE15} $RPM_BUILD_ROOT%{_unitdir}/zabbix-server-pgsql.service - -# Ghosted alternatives -touch $RPM_BUILD_ROOT%{_unitdir}/zabbix-server.service -touch $RPM_BUILD_ROOT%{_unitdir}/zabbix-proxy.service - -# Install compatibility links for config files -#TODO: Switch to .wants files instead! -ln -sf %{_sysconfdir}/zabbix_agent.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/zabbix_agent.conf -ln -sf %{_sysconfdir}/zabbix_agentd.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/zabbix_agentd.conf -ln -sf %{_sysconfdir}/zabbix_server.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/zabbix_server.conf -ln -sf %{_sysconfdir}/zabbix_proxy.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/zabbix_proxy.conf -ln -sf %{_sharedstatedir}/zabbixsrv/externalscripts $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/externalscripts -ln -sf %{_sharedstatedir}/zabbixsrv/alertscripts $RPM_BUILD_ROOT%{_sysconfdir}/%{srcname}/alertscripts -#TODO: What does that do to existing directories? - -# Directory for fping spooling files -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} - 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 - cp -pR upgrades/dbpatches/2.0/$db/* $datadir/upgrades/2.0 -done - -install -dm 755 $RPM_BUILD_ROOT%{_datadir}/%{srcname}-sqlite3 -cp -p database/sqlite3/schema.sql $RPM_BUILD_ROOT%{_datadir}/%{srcname}-sqlite3 - -# systemd tmpfiles -mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d -install -m 0644 -p %{SOURCE9} $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d/zabbix.conf -mkdir -p %{buildroot}/run -install -d -m 0755 %{buildroot}/run/zabbix/ - - -%post server -%systemd_post zabbix-server.service - -if [ $1 -gt 1 ] ; then - # Apply permissions also in *.rpmnew upgrades from old permissive ones - chmod 0600 %{_sysconfdir}/zabbix_server.conf - chown zabbixsrv:zabbix %{_sysconfdir}/zabbix_server.conf -fi -: - -%post server-mysql -%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_server \ - %{srcname}-server %{_sbindir}/%{srcname}_server_mysql 10 \ - --slave %{_unitdir}/zabbix-server.service %{srcname}-server-systemd \ - %{_unitdir}/zabbix-server-mysql.service - -%post server-pgsql -%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_server \ - %{srcname}-server %{_sbindir}/%{srcname}_server_pgsql 10 \ - --slave %{_unitdir}/zabbix-server.service %{srcname}-server-systemd \ - %{_unitdir}/zabbix-server-pgsql.service - -%post proxy -%systemd_post zabbix-proxy.service - -if [ $1 -gt 1 ] ; then - # Apply permissions also in *.rpmnew upgrades from old permissive ones - chmod 0600 %{_sysconfdir}/zabbix_proxy.conf - chown zabbixsrv:zabbix %{_sysconfdir}/zabbix_proxy.conf -fi -: - -%post proxy-mysql -%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ - %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_mysql 10 \ - --slave %{_unitdir}/zabbix-proxy.service %{srcname}-proxy-systemd \ - %{_unitdir}/zabbix-proxy-mysql.service - -%post proxy-pgsql -%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ - %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_pgsql 10 \ - --slave %{_unitdir}/zabbix-proxy.service %{srcname}-proxy-systemd \ - %{_unitdir}/zabbix-proxy-pgsql.service - -%post proxy-sqlite3 -%{_sbindir}/update-alternatives --install %{_sbindir}/%{srcname}_proxy \ - %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_sqlite3 10 \ - --slave %{_unitdir}/zabbix-proxy.service %{srcname}-proxy-systemd \ - %{_unitdir}/zabbix-proxy-sqlite3.service - -%pre agent -getent group zabbix > /dev/null || groupadd -r zabbix -getent passwd zabbix > /dev/null || \ - useradd -r -g zabbix -d %{_sharedstatedir}/zabbix -s /sbin/nologin \ - -c "Zabbix Monitoring System" zabbix -: - -%post agent -%systemd_post zabbix-agent.service - -%pre server -getent group zabbix > /dev/null || groupadd -r zabbix -getent passwd zabbix > /dev/null || \ - useradd -r -g zabbix -d %{_sharedstatedir}/zabbix -s /sbin/nologin \ - -c "Zabbix Monitoring System" zabbix -getent passwd zabbixsrv > /dev/null || \ - useradd -r -g zabbix -d %{_sharedstatedir}/zabbixsrv -s /sbin/nologin \ - -c "Zabbix Monitoring System -- Proxy or server" zabbixsrv -: - -%preun server - %systemd_preun zabbix-server.service - -%pre proxy -getent group zabbix > /dev/null || groupadd -r zabbix -getent passwd zabbix > /dev/null || \ - useradd -r -g zabbix -d %{_sharedstatedir}/zabbix -s /sbin/nologin \ - -c "Zabbix Monitoring System" zabbix -getent passwd zabbixsrv > /dev/null || \ - useradd -r -g zabbix -d %{_sharedstatedir}/zabbixsrv -s /sbin/nologin \ - -c "Zabbix Monitoring System -- Proxy or server" zabbixsrv -: - -%preun proxy -%systemd_preun zabbix-proxy.service - -%preun agent -%systemd_preun zabbix-agent.service - -%postun server -%systemd_postun_with_restart zabbix-server.service - -%postun server-mysql -if [ $1 -eq 0 ] ; then - %{_sbindir}/update-alternatives --remove %{srcname}-server %{_sbindir}/%{srcname}_server_mysql -fi - -%postun server-pgsql -if [ $1 -eq 0 ] ; then - %{_sbindir}/update-alternatives --remove %{srcname}-server %{_sbindir}/%{srcname}_server_pgsql -fi - -%postun proxy -%systemd_postun_with_restart zabbix-proxy.service - -%postun proxy-mysql -if [ $1 -eq 0 ] ; then - %{_sbindir}/update-alternatives --remove %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_mysql -fi - -%postun proxy-pgsql -if [ $1 -eq 0 ] ; then - %{_sbindir}/update-alternatives --remove %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_pgsql -fi - -%postun proxy-sqlite3 -if [ $1 -eq 0 ] ; then - %{_sbindir}/update-alternatives --remove %{srcname}-proxy %{_sbindir}/%{srcname}_proxy_sqlite3 -fi - -%postun agent -%systemd_postun_with_restart zabbix-agent.service - - -%files -%doc AUTHORS ChangeLog COPYING NEWS README %{srcname}-fedora.README -%dir %{_sysconfdir}/%{srcname} -%config(noreplace) %{_sysconfdir}/zabbix_agentd.conf -%config(noreplace) %{_sysconfdir}/%{srcname}/zabbix_agentd.conf -%{_bindir}/zabbix_get -%{_bindir}/zabbix_sender -%{_mandir}/man1/zabbix_get.1* -%{_mandir}/man1/zabbix_sender.1* - -%files server -%doc misc/snmptrap/zabbix_trap_receiver.pl -%attr(0775,zabbix,zabbix) %dir /run/zabbix/ -%{_prefix}/lib/tmpfiles.d/zabbix.conf -%attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix -%attr(0600,zabbixsrv,zabbix) %config(noreplace) %{_sysconfdir}/zabbix_server.conf -%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 -%ghost %{_unitdir}/zabbix-server.service -%{_mandir}/man8/zabbix_server.8* - -%files server-mysql -%{_datadir}/%{srcname}-mysql -%{_sbindir}/zabbix_server_mysql -%{_unitdir}/zabbix-server-mysql.service - -%files server-pgsql -%{_datadir}/%{srcname}-postgresql -%{_sbindir}/zabbix_server_pgsql -%{_unitdir}/zabbix-server-pgsql.service - -%files agent -%doc conf/zabbix_agentd/*.conf -%attr(0775,zabbix,zabbix) %dir /run/zabbix/ -%{_prefix}/lib/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 -%{_unitdir}/zabbix-agent.service -%{_sbindir}/zabbix_agent -%{_sbindir}/zabbix_agentd -%{_mandir}/man8/zabbix_agentd.8* - -%files proxy -%doc misc/snmptrap/zabbix_trap_receiver.pl -%attr(0775,zabbix,zabbix) %dir /run/zabbix/ -%{_prefix}/lib/tmpfiles.d/zabbix.conf -%attr(0775,root,zabbix) %dir %{_localstatedir}/log/zabbix -%attr(0600,zabbixsrv,zabbix) %config(noreplace) %{_sysconfdir}/zabbix_proxy.conf -%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 -%ghost %{_unitdir}/zabbix-proxy.service -%{_mandir}/man8/zabbix_proxy.8* - -%files proxy-mysql -%{_datadir}/%{srcname}-mysql -%{_sbindir}/zabbix_proxy_mysql -%{_unitdir}/zabbix-proxy-mysql.service - -%files proxy-pgsql -%{_datadir}/%{srcname}-postgresql -%{_sbindir}/zabbix_proxy_pgsql -%{_unitdir}/zabbix-proxy-pgsql.service - -%files proxy-sqlite3 -%{_datadir}/%{srcname}-sqlite3 -%{_sbindir}/zabbix_proxy_sqlite3 -%{_unitdir}/zabbix-proxy-sqlite3.service - -%files web -%dir %attr(0750,apache,apache) %{_sysconfdir}/%{srcname}/web -%ghost %attr(0644,apache,apache) %config(noreplace) %{_sysconfdir}/%{srcname}/web/zabbix.conf.php -%attr(0644,apache,apache) %config(noreplace) %{_sysconfdir}/%{srcname}/web/maintenance.inc.php -%config(noreplace) %{_sysconfdir}/httpd/conf.d/zabbix.conf -%{_datadir}/%{srcname} - -%files web-mysql - -%files web-pgsql - -%changelog -* Fri Jun 23 2017 Volker Fröhlich - 2.0.21-1 -- New upstream release - -* Sun Dec 11 2016 Volker Fröhlich - 2.0.20-1 -- New upstream release - -* Sat Oct 08 2016 Volker Fröhlich - 2.0.19-1 -- New upstream release - -* Thu Nov 12 2015 Volker Fröhlich - 2.0.16-1 -- New upstream release - -* Tue Aug 11 2015 Volker Fröhlich - 2.0.15-1 -- New upstream release - -* Wed Sep 10 2014 Volker Fröhlich - 2.0.13-1 -- New upstream release; Remove obsolete patches for ZBX-8151 and ZBX-8238 -- Use the upstream tarball, now that non-free json was replaced with android-json -- Clean between builds, otherwise zabbix_{proxy,server} are compiled - again on install; make server and proxy package noarch now -- Set the service type to forking in unit files (BZ 1132437), - add PIDFile entry, remove RemainAfterExit, change /var/run to /run -- Install tmpfiles configuration in the proper location per guidelines, - thus solving the startup trouble due to missing directories - (respectively BZ 1115251, 1081584, 982001, 1135696) -- Harmonize package descriptions and summaries - -* Fri Jun 20 2014 Volker Fröhlich - 2.0.12-3 -- Patch for ZBX-8151 (Local file inclusion via XXE attack) -- CVE-2014-3005 - -* Tue Jun 3 2014 Volker Fröhlich - 2.0.12-2 -- Don't remove su directive from logrotate config in error -- Adapt logrotate.in file and sed invocation from 2.2 packages - -* Tue Jun 3 2014 Volker Fröhlich - 2.0.12-1 -- New upstream release -- Patch for ZBX-8238 (logrt may continue reading an old file repeatedly) - -* Sun Feb 16 2014 Volker Fröhlich - 2.0.11-2 -- Remove if clauses for Fedora/RHEL as they are obsolete in EL 7 -- Use systemd scriplet macros (BZ#850378) -- Remove init scripts - -* Wed Feb 12 2014 Volker Fröhlich - 2.0.11-1 -- New upstream release -- Truncate changelog - -* Sun Dec 15 2013 Volker Fröhlich - 2.0.10-2 -- The start function of the proxy init script had a typo causing failure -- Improved the section on running multiple instances in the README - -* Fri Dec 13 2013 Volker Fröhlich - 2.0.10-1 -- New upstream release -- Drop obsolete patch ZBX-7479 -- Improve init scripts to not kill other instances (BZ#1018293) -- General overhaul of init scripts and documentation in README -- Harmonize scriptlet if-clause style - -* Sun Nov 3 2013 Volker Fröhlich - 2.0.9-2 -- Fix vulnerability for remote command execution injection - (ZBX-7479, CVE-2013-6824) - -* Wed Oct 9 2013 Volker Fröhlich - 2.0.9-1 -- New upstream release -- Drop obsolete patches ZBX-6804, ZBX-7091, ZBX-6922, ZBX-6992 - -* Mon Sep 23 2013 Volker Fröhlich - 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) - -* Fri Sep 13 2013 Volker Fröhlich - 2.0.8-2 -- Add php-ldap as a requirement for the frontend -- Add patch for ZBX-6992 - -* Fri Aug 23 2013 Volker Fröhlich - 2.0.8-1 -- New upstream release -- Create and configure a spooling directory for fping files outside of /tmp -- Update README to reflect that and add a SELinux section -- Drop PrivateTmp from systemd unit files -- Drop patch for ZBX-6526 (solved upstream) -- Drop patch for CVE-2012-6086 (solved upstream) -- Correct path for the flash applet when removing -- Truncate changelog - -* Tue Jul 30 2013 Volker Fröhlich - 2.0.6-3 -- Backport fix for CVE-2012-6086 - -* Tue May 07 2013 Volker Fröhlich - 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 - 2.0.6-1 -- New upstream release -- Drop ZBX-6290 and ZBX-6318 patches - -* Tue Mar 19 2013 Volker Fröhlich - 2.0.5-3 -- Include patch for ZBX-6318 - -* Tue Feb 12 2013 Volker Fröhlich - 2.0.5-2 -- Include patch for ZBX-6290 - -* Tue Feb 12 2013 Volker Fröhlich - 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 - 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 - 2.0.4-4 -- Remove zabbix_get plus manpage from the proxy files section -- Solve conflict for externalscripts symlink between proxy and - server package - -* Thu Jan 17 2013 Volker Fröhlich - 2.0.4-3 -- Patch for CVE-2013-1364 - -* Mon Jan 14 2013 Volker Fröhlich - 2.0.4-2 -- 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 - -* Sat Dec 8 2012 Volker Fröhlich - 2.0.4-1 -- New upstream release - -* Fri Dec 7 2012 Volker Fröhlich - 2.0.3-7 -- Add SNMP source IP address patch - -* Mon Nov 26 2012 Volker Fröhlich - 2.0.3-6 -- Apply fping 3 patch only for Fedora - -* Tue Nov 13 2012 Volker Fröhlich - 2.0.3-5 -- Adapt httpd configuration file for Apache 2.4 (BZ#871498) - -* Thu Nov 8 2012 Volker Fröhlich - 2.0.3-4 -- Require php explicitly again -- Remove traces of /usr/local in configuration files -- Improve Fedora README file - -* Sun Oct 14 2012 Volker Fröhlich - 2.0.3-3 -- Correct capitalization in unit files, init scripts and package description -- Improve sysconfig sourcing in init scripts -- Correct post-script permissions and owner on rpmnew files -- Obsolete sqlite web and server sub-package - -* Sun Oct 14 2012 Volker Fröhlich - 2.0.3-2 -- Include agent configuration file in base package for zabbix_sender -- Stricter permissions for server config file -- Adapt DB patches to our file layout -- Remove conditional around Source9 -- doc-sub-package obsolete only for Fedora, where the package keeps - the name "zabbix" -- Add missing requirement for proxy scriplet -- Remove Requires php because the PHP modules serve this purpose -- Use systemd's PrivateTmp only for F17 and up -- Correct proxy and server pre-scriplet (usergroup) - -* Fri Oct 5 2012 Volker Fröhlich - 2.0.3-1 -- New upstream release -- Add Fedora specific README - -* Mon Aug 27 2012 Volker Fröhlich - 2.0.2-3 -- Eliminate Sqlite server and web sub-package - They never worked and are considered experimental by upstream -- Harmonize conditionals -- Put maintenance configuration in web configuration directory -- Adapt man pages to file layout -- Remove backup files from frontend -- Move maintenance configuration file to /etc/... -- Move ExternalScripts and AlertScripts to daemon home directory -- Don't ship SQL scripts as documentation - -* Sun Aug 26 2012 Volker Fröhlich - 2.0.2-2 -- Use separate daemon users, so the agent can not parse the - database password -- Use PrivateTmp in unit files - -* Wed Aug 15 2012 Volker Fröhlich - 2.0.2-1 -- New upstream release -- Unified specfile for sys-v-init scripts and systemd -- Switch to Alternatives system -- Source from systemconfig in init scripts - -* Sun Jul 22 2012 Fedora Release Engineering - 2.0.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - -* Thu Jul 12 2012 Dan Horák - 2.0.1-1 -- update to 2.0.1 -- rebased patches -- upstream location (/etc) for config files is used with symlinks to the old /etc/zabbix -- dropped our own SNMP trap processor, upstream one running directly under net-snmp daemon is used instead -- moved zabbix_get and zabbix_sender tools to the main package