CAP_EVENT was omitted on pidfiles (in
pidfile_open()). There seems no reason why a process that creates
and writes a pidfile cannot monitor events on that file. This mod adds
the capability.
As a concrete example of why one might want to do this: at $JOB there
is a daemon that is started very early in the rc sequence; in
particular it is started before rc.d/cleanvar. When cleanvar runs, it
removes the pidfile for the daemon. If an attempt is made to start
that daemon later, it checks for the existence of the pidfile, but the
pidfile no longer (apparently) exists, so the daemon starts up and
there are now two copies of the daemon running. In order to avoid
this, I attempted to have the daemon monitor its pidfile via kevent
and re-create it if it is deleted but found that the attempt to
register the event failed since the process lacked the CAP_EVENT
capability. Adding it (as here) fixed the issue.