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

Zabbix agent init script incorrectly detects running process on OpenVZ host

XMLWordPrintable

      Zabbix agent init script incorrectly detects running process on Debian OpenVZ host.

      Here is an example:

      1. First check running process on OpenVZ guest
        root@vm200:/# service zabbix-agent status
        [ ok ] zabbix_agentd is running.
        root@vm200:/# service zabbix-agent stop
        [ ok ] Stopping Zabbix agent: zabbix_agentd.
        root@vm200:/# service zabbix-agent status
        [FAIL] zabbix_agentd is not running ... failed!
        

        Init script process detection works as expected

      2. Then check running process on OpenVZ host
        root@srv5:~# service zabbix-agent status
        zabbix_agentd is running.
        root@srv5:~# service zabbix-agent stop  
        Stopping Zabbix agent: zabbix_agentd.
        root@srv5:~# service zabbix-agent status
        zabbix_agentd is running.
        

        Init script incorrectly detects running process because the same process name already running on guest

      How to fix

      --- /etc/init.d/zabbix-agent.orig       2014-06-13 09:48:35.732033503 +0300
      +++ /etc/init.d/zabbix-agent    2014-06-13 09:49:06.609563758 +0300
      @@ -48,7 +48,7 @@
           esac
              ;;
         status)
      -    status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
      +    status_of_proc -p "$PID" "$DAEMON" "$NAME" && exit 0 || exit $?
           ;;
         restart|force-reload)
              $0 stop
      

      After this changes process detections works as expected on OpenVZ host

      root@srv5:~# service zabbix-agent status
      zabbix_agentd is not running ... failed!
      root@srv5:~# service zabbix-agent start
      Starting Zabbix agent: zabbix_agentd.
      root@srv5:~# service zabbix-agent status
      zabbix_agentd is running.
      root@srv5:~# service zabbix-agent stop
      Stopping Zabbix agent: zabbix_agentd.
      root@srv5:~# service zabbix-agent status
      zabbix_agentd is not running ... failed!
      

      Please include this fix into standard Debian package.

            Unassigned Unassigned
            aleksey Aleksey Chudov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: