Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-22919

Zabbix proxy still hanging on shutdown

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 5.0.35
    • None
    • Product delivery backlog

      The issue described in https://support.zabbix.com/browse/ZBX-15602 persists

      Debian 11, zabbix-proxy-pgsql_5.0.35

      I suppose zabbix-server suffers from the same issue

       

      Steps to reproduce:

      1. Stop postgresql.service
      2. Shutdown/reboot host

      Result:

      Notice how host will hang on stopping zabbix proxy (no limit)

      Expected:

      Zabbix proxy should not prevent host from shutting down/restarting, within a sensible time period

       

      Aside from the mysterious reason to have TimeoutSec=Infinity, there only seem to be an order dependency between zabbix-proxy and postgresql systemd unit files, not a requirement dependency. From my limited understanding of systemd, using After=postgresql.service option will only define the order in which services should be started, but will not make it so that stopping postgresql.service will stop zabbix-proxy.service. This is what should happen, and that would require using one of Wants=, Requires=, PartOf=, ...

      https://www.freedesktop.org/software/systemd/man/systemd.unit.html

       

      Current unit file

      [Unit]
      Description=Zabbix Proxy
      After=syslog.target
      After=network.target
      After=postgresql.service
      
      [Service]
      Environment="CONFFILE=/etc/zabbix/zabbix_proxy.conf"
      EnvironmentFile=-/etc/default/zabbix-proxy
      Type=forking
      Restart=on-failure
      PIDFile=/run/zabbix/zabbix_proxy.pid
      KillMode=control-group
      ExecStart=/usr/sbin/zabbix_proxy -c $CONFFILE
      ExecStop=/bin/kill -SIGTERM $MAINPID
      RestartSec=10s
      TimeoutSec=infinity
      
      [Install]
      WantedBy=multi-user.target

       

      For those interested, i have added the following for my use case (not responsible for loss of proxy data, bla bla):

      [Unit]
      PartOf=postgresql.service
      
      [Service]
      TimeoutSec=90s

            yurii Jurijs Klopovskis
            jonybat Jonybat
            Team B
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: