[zabbix/el6] Version 1.8.19 and reworked init scripts (BZ#1018293)

Volker Fröhlich volter at fedoraproject.org
Wed Dec 25 16:06:05 UTC 2013


commit 2ca418a1ae9a9596e813de60cbf6c2c0cccc0750
Author: Volker Fröhlich <volker27 at gmx.at>
Date:   Wed Dec 25 17:04:46 2013 +0100

    Version 1.8.19 and reworked init scripts (BZ#1018293)
    
    - New upstream release
    - General overhaul of init scripts and documentation in README
    - Improve init scripts to not kill other instances (BZ#1018293)
    - Drop obsolete patch for CVE-2013-6824 and old and unused patch

 .gitignore                   |    1 +
 sources                      |    2 +-
 zabbix-1.8.16-ldap.patch     |   50 --------------------------
 zabbix-1.8.18-ZBX-7479.patch |   81 ------------------------------------------
 zabbix-agent.init            |   39 ++++++++++++--------
 zabbix-proxy.init            |   34 +++++++++++------
 zabbix-server.init           |   38 ++++++++++++-------
 zabbix.spec                  |   14 ++++---
 8 files changed, 80 insertions(+), 179 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 4434d70..dc1b39c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,4 @@ zabbix-1.8.2.tar.gz
 /zabbix-1.8.16.tar.gz
 /zabbix-1.8.17.tar.gz
 /zabbix-1.8.18.tar.gz
+/zabbix-1.8.19.tar.gz
diff --git a/sources b/sources
index fad159c..f66ee48 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-b6a8646b38e0cedcef23110a956169c6  zabbix-1.8.18.tar.gz
+f61b6a871dfb44f04273bac1f45790e3  zabbix-1.8.19.tar.gz
diff --git a/zabbix-agent.init b/zabbix-agent.init
index 70d4ced..aabed52 100644
--- a/zabbix-agent.init
+++ b/zabbix-agent.init
@@ -1,21 +1,19 @@
 #!/bin/sh
 #
 # chkconfig: - 86 14
-# description: ZABBIX agent daemon
-# processname: zabbix_agentd
-# config: /etc/zabbix/zabbix_agentd.conf
+# description: Zabbix agent daemon
 #
 
 ### BEGIN INIT INFO
 # Provides: zabbix-agent
 # Required-Start: $local_fs $network
 # Required-Stop: $local_fs $network
-# Should-Start: zabbix zabbix-proxy
-# Should-Stop: zabbix zabbix-proxy
+# 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
+# Short-Description: Start and stop Zabbix agent
+# Description: Zabbix agent daemon
 ### END INIT INFO
 
 # Source function library.
@@ -23,14 +21,25 @@
 
 exec=/usr/sbin/zabbix_agentd
 prog=${exec##*/}
-lockfile=/var/lock/subsys/zabbix-agent
-syscf=zabbix-agent
-[ -e /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf
+syscf=${0##*/}
+lockfile=/var/lock/subsys/$syscf
+
+[ -f /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf
+
+config=${CFG_FILE:-/etc/zabbix/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 $exec
+    echo -n $"Starting Zabbix agent: "
+    daemon --pidfile "$pidfile" $exec $param
     rv=$?
     echo
     [ $rv -eq 0 ] && touch $lockfile
@@ -39,7 +48,7 @@ start()
 
 stop()
 {
-    echo -n $"Shutting down ZABBIX agent: "
+    echo -n $"Shutting down Zabbix agent: "
     killproc $prog
     rv=$?
     echo
@@ -61,10 +70,10 @@ case "$1" in
         restart
         ;;
     status)
-        status $prog
+        status -p "$pidfile" -l $prog $exec
         ;;
     try-restart|condrestart)
-        if status $prog >/dev/null ; then
+        if status -p "$pidfile" -l $prog $exec >/dev/null ; then
             restart
         fi
         ;;
diff --git a/zabbix-proxy.init b/zabbix-proxy.init
index 5fbf9d6..4f5c34d 100644
--- a/zabbix-proxy.init
+++ b/zabbix-proxy.init
@@ -11,8 +11,8 @@
 # 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
+# Short-Description: Start and stop Zabbix proxy
+# Description: Zabbix proxy daemon
 ### END INIT INFO
 
 # Source function library.
@@ -28,15 +28,25 @@ else
     exit 5
 fi
 prog=${exec##*/}
-lockfile=/var/lock/subsys/zabbix-proxy
-conf=
-syscf=zabbix-proxy
-[ -e /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf
+syscf=${0##*/}
+lockfile=/var/lock/subsys/$syscf
+
+[ -f /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf
+
+config=${CFG_FILE:-/etc/zabbix/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 $exec
+    echo -n $"Starting Zabbix proxy: "
+    daemon --pidfile "$pidfile" $exec $param
     rv=$?
     echo
     [ $rv -eq 0 ] && touch $lockfile
@@ -45,8 +55,8 @@ start()
 
 stop()
 {
-    echo -n $"Shutting down ZABBIX proxy: "
-    killproc $prog
+    echo -n $"Shutting down Zabbix proxy: "
+    killproc -p "$pidfile" $prog
     rv=$?
     echo
     [ $rv -eq 0 ] && rm -f $lockfile
@@ -67,10 +77,10 @@ case "$1" in
         restart
         ;;
     status)
-        status $prog
+        status -p "$pidfile" -l $prog $exec
         ;;
     try-restart|condrestart)
-        if status $prog >/dev/null ; then
+        if status -p "$pidfile" -l $prog $exec >/dev/null ; then
             restart
         fi
         ;;
diff --git a/zabbix-server.init b/zabbix-server.init
index a258dbe..b5ae000 100644
--- a/zabbix-server.init
+++ b/zabbix-server.init
@@ -1,18 +1,17 @@
 #!/bin/sh
 #
 # chkconfig: - 85 15
-# description: ZABBIX server daemon
-# config: /etc/zabbix/zabbix_server.conf
+# description: Zabbix server daemon
 #
 
 ### BEGIN INIT INFO
-# Provides: zabbix
+# 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
+# Short-Description: Start and stop Zabbix server
+# Description: Zabbix server daemon
 ### END INIT INFO
 
 # Source function library.
@@ -28,14 +27,25 @@ else
     exit 5
 fi
 prog=${exec##*/}
-lockfile=/var/lock/subsys/zabbix
-syscf=zabbix-server
-[ -e /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf
+syscf=${0##*/}
+lockfile=/var/lock/subsys/$syscf
+
+[ -f /etc/sysconfig/$syscf ] && . /etc/sysconfig/$syscf
+
+config=${CFG_FILE:-/etc/zabbix/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 $exec
+    echo -n $"Starting Zabbix server: "
+    daemon --pidfile "$pidfile" $exec $param
     rv=$?
     echo
     [ $rv -eq 0 ] && touch $lockfile
@@ -44,8 +54,8 @@ start()
 
 stop()
 {
-    echo -n $"Shutting down ZABBIX server: "
-    killproc $prog
+    echo -n $"Shutting down Zabbix server: "
+    killproc -p "$pidfile" $prog
     rv=$?
     echo
     [ $rv -eq 0 ] && rm -f $lockfile
@@ -66,10 +76,10 @@ case "$1" in
         restart
         ;;
     status)
-        status $prog
+        status -p "$pidfile" -l $prog $exec
         ;;
     try-restart|condrestart)
-        if status $prog >/dev/null ; then
+        if status -p "$pidfile" -l $prog $exec >/dev/null ; then
             restart
         fi
         ;;
diff --git a/zabbix.spec b/zabbix.spec
index 826bd57..3227eb3 100644
--- a/zabbix.spec
+++ b/zabbix.spec
@@ -6,8 +6,8 @@
 #   various backup files (*.rpm{orig,new,save}, *~ etc) in that dir.
 
 Name:           zabbix
-Version:        1.8.18
-Release:        2%{?dist}
+Version:        1.8.19
+Release:        1%{?dist}
 Summary:        Open-source monitoring solution for your IT infrastructure
 
 Group:          Applications/Internet
@@ -29,9 +29,6 @@ Patch0:         zabbix-1.8.4-config.patch
 Patch1:         zabbix-1.8.4-fonts-config.patch
 # remove flash content (#737337)
 Patch2:         zabbix-1.8.8-no-flash.patch
-# Fix vulnerability for remote command execution injection CVE-2013-6824
-# https://support.zabbix.com/browse/ZBX-7479
-Patch3:         zabbix-1.8.18-ZBX-7479.patch
 
 Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -265,7 +262,6 @@ Zabbix web frontend for SQLite
 # remove included fonts
 rm -rf frontends/php/fonts
 %endif
-%patch3 -p0
 
 # remove executable permissions
 chmod a-x upgrades/dbpatches/1.8/mysql/upgrade
@@ -617,6 +613,12 @@ fi
 
 
 %changelog
+* Sat Dec 21 2013 Volker Fröhlich <volker27 at gmx.at> - 1.8.19-1
+- New upstream release
+- Drop obsolete patch for CVE-2013-6824
+- Improve init scripts to not kill other instances (BZ#1018293)
+- General overhaul of init scripts and documentation in README
+
 * Tue Nov  3 2013 Volker Fröhlich <volker27 at gmx.at> - 1.8.18-2
 - Fix vulnerability for remote command execution injection
   (ZBX-7479, CVE-2013-6824)


More information about the scm-commits mailing list