freebsd-dev/sbin/devd
Ian Lepore e1334f935f Fix a descriptor leak in devd. Clients reading /var/run/devd.pipe can close
their socket connection any time, and devd only notices that when it gets an
error trying to write an event to the client.  On a system with no device
change activity, clients could connect and disappear repeatedly without devd
noticing, leading to an ever-growing list of open socket descriptors in devd.

Now devd uses poll(2) looking for POLLHUP on all existing clients every time
a new client connection is established, and also periodically (once a minute)
to proactively find zombie clients and reap the socket descriptors.  It also
now has a connection limit, configurable with a new -l <num> command line arg.
When the maximum number of connections is reached it stops accepting new
connections until some current clients drop off.

Reviewed by:	imp
Approved by:	cognet (mentor)
2013-01-30 15:21:18 +00:00
..
devd.8 Fix a descriptor leak in devd. Clients reading /var/run/devd.pipe can close 2013-01-30 15:21:18 +00:00
devd.cc Fix a descriptor leak in devd. Clients reading /var/run/devd.pipe can close 2013-01-30 15:21:18 +00:00
devd.conf.5 document acpi_cpu devd notification about _CST change 2012-10-20 09:40:34 +00:00
devd.h Add the ability to match the on a media type of the device in question. 2005-07-10 03:37:15 +00:00
devd.hh Prefer the use of initalizer lists to ctor assignment. 2012-12-06 01:25:21 +00:00
Makefile Bump WARNS where possible. 2010-02-15 14:07:40 +00:00
parse.y Fix world after byacc import: 2012-05-22 16:33:10 +00:00
token.l Don't generate input() since it's not used. 2010-11-22 12:33:48 +00:00