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

Zabbix daemons do not exit on FreeBSD

    XMLWordPrintable

    Details

    • Team:
      Team A
    • Sprint:
      Sprint 55 (Aug 2019)
    • Story Points:
      0.125

      Description

      Since 4.0.11, the Zabbix daemons (at least the agent and server; I'm not running the proxy) cannot be stopped using normal means on FreeBSD. (The "normal means" is sending SIGTERM to the process in the pid file.)

      Until 4.0.10, the reaction of the parent process to receiving SIGTERM was to SIGTERM its children, wait for them to exit, then exit itself:

      kill(54207,SIGTERM) = 0 (0x0)
      kill(54208,SIGTERM) = 0 (0x0)
      kill(54209,SIGTERM) = 0 (0x0)
      kill(54210,SIGTERM) = 0 (0x0)
      kill(54211,SIGTERM) = 0 (0x0)
      wait4(54207,{ EXITED,val=1 },0x0,0x0) = 54207 (0xd3bf)
      wait4(54208,{ EXITED,val=1 },0x0,0x0) = 54208 (0xd3c0)
      wait4(54209,{ EXITED,val=1 },0x0,0x0) = 54209 (0xd3c1)
      wait4(54210,{ EXITED,val=1 },0x0,0x0) = 54210 (0xd3c2)
      wait4(54211,{ EXITED,val=1 },0x0,0x0) = 54211 (0xd3c3)

      Since 4.0.11, it instead sends SIGUSR2, immediately followed by SIGABRT, which it fails to deliver:

      kill(82225,SIGUSR2) = 0 (0x0)
      kill(82226,SIGUSR2) = 0 (0x0)
      kill(82227,SIGUSR2) = 0 (0x0)
      kill(82228,SIGUSR2) = 0 (0x0)
      kill(82229,SIGUSR2) = 0 (0x0)
      kill(82225,SIGQUIT) ERR#1 'Operation not permitted'
      kill(82226,SIGQUIT) ERR#1 'Operation not permitted'
      kill(82227,SIGQUIT) ERR#1 'Operation not permitted'
      kill(82228,SIGQUIT) ERR#1 'Operation not permitted'
      kill(82229,SIGQUIT) ERR#1 'Operation not permitted'

      It does nothing after that, i.e. it does not wait for children to exit.

      Bisecting between the 4.0.10 and 4.0.11 tags leads to 

      commit a5ab84490f2046b65de5b8e53b5452acd2f37c52
      Merge: effc9419b6 8d515dacf0
      Author: Miks Kronkalns <[email protected]>
      Date: Fri Jul 5 17:30:44 2019 +0300

      as the guilty commit, which unfortunately is a merge. My git-fu is not good enough to determine where to look further.

      Steps to reproduce:

      1. service zabbix_agentd start
      2. service zabbix_agentd stop
      3. Sit and gather dust

      Result:

      The processes do not exit.
      Expected:

      The processes exit.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vso Vladislavs Sokurenko
              Reporter:
              chrullrich Christian Ullrich
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: