[Bug 207896] net-mgmt/zabbix2-server zabbix{2,22,24}-{agent,proxy,server) rc.d fixes for SysV IPC leak, restart race, custom PATH

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Mar 11 08:41:54 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207896

            Bug ID: 207896
           Summary: net-mgmt/zabbix2-server
                    zabbix{2,22,24}-{agent,proxy,server) rc.d fixes for
                    SysV IPC leak, restart race, custom PATH
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs at FreeBSD.org
          Reporter: kbowling at freebsd.org
                CC: pakhom at pakhom.spb.ru
                CC: pakhom at pakhom.spb.ru
             Flags: maintainer-feedback?(pakhom at pakhom.spb.ru)

Created attachment 167991
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=167991&action=edit
update rc.d scripts to SIGTERM only master PID

We were losing many hundred zabbix agents out of many thousands when we would
restart zabbix_agentd using the rc.d script in ports currently.

I believe the root cause is that rc.subr by default checks against the command
name and was sending SIGTERM to the parent and all the child processes (we run
w/~32 children because if you run out with concurrent polls, the check will
fail).  The processes have a sighandler and may terminate uncleanly if the
other process are all SIGTERMing.  ipcs may show shared memory and/or a
semaphore even though there are no processes running, and the agent cannot be
[re]started until those are manually cleared with ipcrm.  The SIGTERM to all
processes also seemed to cause restart to race occasionally, in that some of
the child processes were still around while the new one was starting even if
there was no IPC leak.. may be hard to trigger in practice unless you have long
running userparams(?).

This patch also sets a default PATH and allows the user to override it in
rc.conf.  This is often necessary for userparams on the agent, or externals on
the proxy and server.

I've only tested the agent rc.d changes, but assume the proxy and server face
these same issues.  I'm not very familiar with rc.subr so suggestions for
improvement welcome.

Interesting poll of other platforms I can easily check with respect to pidfile:
 Ubuntu 14.04 SysV init gets it right, Ubuntu 14.04 upstart job gets it wrong,
CentOS 5 SysV init gets it wrong, and CentOS 7 systemd service gets it right.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list