]> TLD Linux GIT Repositories - packages/zabbix.git/commitdiff
- wait for Zabbix server proces to exit when stopping service
authorMarcin Krol <hawk@tld-linux.org>
Sun, 12 Feb 2023 12:09:43 +0000 (13:09 +0100)
committerMarcin Krol <hawk@tld-linux.org>
Sun, 12 Feb 2023 12:09:43 +0000 (13:09 +0100)
zabbix.spec
zabbix_agentd.init [changed mode: 0755->0644]
zabbix_proxy.init [changed mode: 0755->0644]
zabbix_server.init [changed mode: 0755->0644]

index 9175efb752d3cbefaa375b4bb7c9e07e028a6bcc..a30dc254c2406077eea5bd89deb999c7d2fd97f6 100644 (file)
@@ -17,7 +17,7 @@ Summary:      Zabbix - network monitoring software
 Summary(pl.UTF-8):     Zabbix - oprogramowanie do monitorowania sieci
 Name:          zabbix
 Version:       6.0.13
-Release:       2
+Release:       3
 License:       GPL v2+
 Group:         Networking/Utilities
 Source0:       https://cdn.zabbix.com/zabbix/sources/stable/6.0/%{name}-%{version}.tar.gz
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index e98e121..a5c5f56
@@ -27,6 +27,9 @@ fi
 # Get service config - may override defaults
 [ -f /etc/sysconfig/zabbix_server ] && . /etc/sysconfig/zabbix_server
 
+# Set default shutdown timeout if it is not set in service config
+ZABBIX_SHUTDOWN_TIMEOUT=${ZABBIX_SHUTDOWN_TIMEOUT:-60}
+
 pidfile="/var/run/zabbix/zabbix_server.pid"
 
 start() {
@@ -51,6 +54,24 @@ stop() {
        # Stop daemons.
        msg_stopping "Zabbix Server"
        killproc --pidfile $pidfile zabbix_server -TERM
+
+       if [ -f "$pidfile" ]; then
+               show "Waiting for Zabbix Server to stop"
+               busy
+
+               timeout=0
+               while : ; do
+                       [ ! -f "$pidfile" ] || break
+                       if [ $timeout -ge $ZABBIX_SHUTDOWN_TIMEOUT ]; then
+                               RETVAL=1
+                               break
+                       fi
+                       sleep 1 && echo -n "."
+                       timeout=$((timeout+1))
+               done
+               ok
+       fi
+
        rm -f /var/lock/subsys/zabbix_server
 }