History log of /freebsd-11-stable/sbin/devd/devd.cc
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 356133 27-Dec-2019 mav

MFC r355718: Fix $() handling, broken since the beginning at r108014.

Due to off-by-one error in brackets counting it consumed the rest of the
string, preventing later variables expansions.


# 331722 29-Mar-2018 eadler

Revert r330897:

This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)


# 331086 17-Mar-2018 eadler

MFC r328430,r328431:

devd: minor nits

- mark usage as noreturn


# 330897 14-Mar-2018 eadler

Partial merge of the SPDX changes

These changes are incomplete but are making it difficult
to determine what other changes can/should be merged.

No objections from: pfg


# 320747 06-Jul-2017 asomers

MFC r320165-r320167

r320165:
devd(8): Remove pidfile on shutdown

Sponsored by: Spectra Logic Corp

r320166:
Require devd to be running for its ATF tests to run

The ATF tests communicate with the system's running devd

PR: 220169
Reported by: gjb
Sponsored by: Spectra Logic Corp

r320167:
zfsd(8): Remove pidfile on shutdown

Sponsored by: Spectra Logic Corp


# 314427 28-Feb-2017 asomers

MFC r311572, r311895, r311928, r311985, r312395, r312417

r311572:
Fix file descriptor leaks in cmp(1)

Also, add a few test cases

Reported by: Coverity
CID: 271624 275338
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9074

r311895:
Fix memory leaks during "tail -r" of an irregular file

* Rewrite r_buf to use standard tail queues instead of a hand-rolled
circular linked list. Free dynamic allocations when done.
* Remove an optimization for the case where the file is a multiple of 128KB
in size and there is a scarcity of memory.
* Add ATF tests for "tail -r" and its variants.

Reported by: Valgrind
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9067

r311928:
Fix build of usr.bin/tail with GCC

Submitted by: pluknet
Reported by: pluknet
MFC after: 27 days
X-MFC-with: 311895
Sponsored by: Spectra Logic Corp

r311985:
Fix uninitialized variable CIDs in route6d

The variables in question are actually return arguments, but it's still good
form to initialize them.

Reported by: Coverity
CID: 979679 979680
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r312395:
Fix several Coverity CIDs in devd

CID 1362055, 1362054: File descriptor leaks during shutdown
CID 1362013: Potential null-termination fail with long network device names
CID 1362097: Uncaught exception during memory pressure
CID 1362017, 1362016: Unchecked errors, possibly resulting in weird behavior
if two devd instances start at the same time.
CID 1362015: Unchecked error that will probably never fail

Reported by: Coverity
CID: 1362055 1362054 1362013 1362097 1362017 1362016 1362015
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r312417:
Fix build of devd with GCC 4.2

Reported by: olivier
Pointy-hat-to: asomers
MFC after: 27 days
X-MFC-with: 312395
Sponsored by: Spectra Logic Corp


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 297529 03-Apr-2016 imp

Add a timestamp variable to the environment. This is when the event
was read from the kernel by devd.


# 297528 03-Apr-2016 imp

Make $_ match the docs.


# 297331 28-Mar-2016 imp

Sometimes, it's useful to export the entire line to an external
program without listening to the devd socket for all events. Define
two new pseudo variables $*, the entire event from devctl and $_,
the entire event without the type character, since it might be easier
to use in some circumstances.


# 292020 09-Dec-2015 asomers

Increase devd's client socket buffer size to 256KB. This is not as large as
it looks, because we'll hit the sockbuf's mbuf limit long before hitting its
data limit. A 256KB data limit allows creating a ZFS pool on about 450
drives without overflowing the client socket buffers.

MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D4476


# 289677 21-Oct-2015 eadler

Fix a ton of speelling errors

arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337


# 270004 14-Aug-2014 asomers

Convert devd's client socket to type SOCK_SEQPACKET.

This change consists of two merges from projects/zfsd/head along with the
addition of an ATF test case for the new functionality.

sbin/devd/tests/Makefile
sbin/devd/tests/client_test.c
Add ATF test cases for reading events from both devd socket types.

r266519:
sbin/devd/devd.8
sbin/devd/devd.cc
Create a new socket, of type SOCK_SEQPACKET, for communicating with
clients. SOCK_SEQPACKET sockets preserve record boundaries,
simplying code in the client. The old SOCK_STREAM socket is retained
for backwards-compatibility with existing clients.

r269993:
sbin/devd/devd.8
Fix grammar bug.

CR: https://reviews.freebsd.org/rS266519
MFC after: 5 days
Sponsored by: Spectra Logic


# 263758 26-Mar-2014 mjg

Update userspace users of hw.bus.devctl_disable.

This fixes breakage resulting from r263754.

Reported by: AN <andy@neu.net>
Reviewed by: imp
Pointy hat to: me


# 262914 07-Mar-2014 asomers

sbin/devd/devd.8
sbin/devd/devd.cc
Add a -q flag to devd that will suppress syslog logging at
LOG_NOTICE or below.

Requested by: ian@ and imp@
MFC after: 3 weeks
Sponsored by: Spectra Logic Corporation


# 259362 13-Dec-2013 asomers

sbin/devd/devd.cc
Promoting the SIGINFO handler's log message from LOG_INFO to
LOG_NOTICE, and promoting the "Processing event ..." message from
LOG_DEBUG to LOG_INFO. Setting the logfile to LOG_NOTICE with this
change will have the same result as setting it to LOG_INFO without
this change. Setting it to LOG_INFO with this change will include
the useful "Processing event ..." messages that were previously at
LOG_DEBUG, without including useless messages like "Pushing table".

The intent of this change is that one can log "Processing event ..."
without logging "Pushing table" and related messages that are sent
for every event. The number of lines actually logged is reduced by
about 75% by making this change and setting syslog to LOG_INFO vs
setting syslog to LOG_DEBUG.

etc/syslog.conf
Changing the recommended loglevel to notice instead of info.

Sponsored by: Spectra Logic Corp
MFC after: 4 weeks


# 259339 13-Dec-2013 asomers

sbin/devd/devd.cc
Increase the size of devd's client socket's send buffer from the
default (8k) to 128k. This prevents clients from getting
POLLHUPped during event storms. For example, during zpool creation,
the kernel emits a resource.fs.zfs.statechange event for every vdev
in the pool. A 128k buffer is large enough to hold the statechange
events for a pool with nearly 800 drives.

Reviewed by: ian, imp
Approved by: ken (mentor)
Sponsored by: Spectra Logic Corp
MFC after: 4 weeks


# 257799 07-Nov-2013 avg

devd: lower priority of action execution logging to info

Reviewed by: asomers


# 257798 07-Nov-2013 avg

devd: fix a typo in a comment

Reviewed by: asomers


# 253046 08-Jul-2013 asomers

Correct the printf format specifier for total_events.
Add __printflike argument checking for devdlog().

Reported by: pjd
Approved by: gibbs (co-mentor)


# 252508 02-Jul-2013 asomers

Explicitly include <cstdarg> to fix compilation with libc++. It is implicitly
included by libstdc++.

Reported By: Oliver Hartmann
Approved by: gibbs (co-mentor, implicit)


# 252485 01-Jul-2013 asomers

style(9) fixes, including the removal of page break characters. No functional
changes.

Approved by: gibbs (co-mentor)


# 252482 01-Jul-2013 asomers

Add a SIGINFO handler to devd. It will send useful statistics to syslog or
stderr as appropriate. Currently, the only statistic printed is the number of
events received.

Reviewed by: eadler
Approved by: gibbs (co-mentor)


# 252481 01-Jul-2013 asomers

Add syslog(3) support to devd(8).

sbin/devd/devd.cc
All output will now go to syslog(3) if devd is daemonized, or stderr
if it's running in the foreground.

sbin/devd/devd.8
Remove the "-D" flag. Filtering messages by priority now
happens in the usual syslog way. For performance reasons, a few
extra-verbose debugging statements are now conditional on the "-d" (do
not daemonize) flag.

etc/syslog.conf
etc/newsyslog.conf
Direct messages from devd(8) to /var/log/devd.log, but leave it
disabled by default

Reviewed by: eadler
Approved by: gibbs (co-mentor)
MFC after: never (removed a command-line option from devd)


# 250186 02-May-2013 eadler

Prefer using the C++ version of the standard headers. These place the
names within the std namespace (and possibly within the global
namespace).

The main advantage is that the C++ versions can provide optimized
versions or simplified interfaces.


# 247763 04-Mar-2013 eadler

devd: Correct typo in comment.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: cperciva (mentor)


# 247762 04-Mar-2013 eadler

devd: Use simpler dst += *x instead of str.append(x, 1).

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: cperciva (mentor)


# 247761 04-Mar-2013 eadler

devd: Use string::empty() instea of string::length() == 0.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: cperciva (mentor)


# 247758 04-Mar-2013 eadler

devd: Avoid unnecessary temporary objects (and simplify the code) when handling std::string.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: cperciva (mentor)


# 247756 04-Mar-2013 eadler

devd: Simplify while (1) { if (x) break; } to while (!x) {}.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: cperciva (mentor)


# 247755 04-Mar-2013 eadler

devd: Remove call to _exit() from signal handler, which also sets a stop flag.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: cperciva (mentor)


# 247754 04-Mar-2013 eadler

devd: Use volatile sig_atomic_t for the flag set by a signal handler.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: cperciva (mentor)


# 247751 04-Mar-2013 eadler

Constify where possible.

Approved by: cperciva (mentor)


# 246134 30-Jan-2013 ian

Improve devd startup time, by tweaking some string handling routines that are
heavily used when parsing config files. Mostly these changes avoid making
temporary copies of the strings, and avoid doing byte at a time append
operations, on the most-used code path.

On a 1.2 GHz ARM processor this reduces the time to parse the config files
from 13 to 6 seconds.

Reviewed by: imp
Approved by: cognet (mentor)


# 246121 30-Jan-2013 ian

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)


# 243932 05-Dec-2012 eadler

Prefer the use of initalizer lists to ctor assignment.

Approved by: cperciva
MFC after: 2 weeks


# 243931 05-Dec-2012 eadler

Avoid the creation of a temporary object by using the prefix operator
for non-primitive types.

Approved by: cperciva
MFC after: 2 weeks


# 243930 05-Dec-2012 eadler

Constify where possible

Approved by: cperciva
MFC after: 2 weeks


# 243907 05-Dec-2012 dim

Fix an old bug in devd, where it uses std::sort() to sort the various
lists it reads from its configuration files on the priority field.

Because some items in the lists have the same priority, and std::sort()
is not stable, the exact order in which the items are enumerated does
not have to correspond to the order they appear in the configuration
files.

Apparently this was never noticed with libstdc++, but with libc++ it
could cause the "uhid" entry from /etc/devd/usb.conf to be used instead
of the "ums" entry (which is earlier in the file). This caused the
problem described in the PR: the USB mouse module was never loaded, and
the other actions (such as starting moused) were not executed.

To fix the problem, make devd use std:stable_sort() instead.

Reported by: Jan Beich <jbeich@tormail.org>
PR: bin/172958
MFC after: 2 weeks


# 240823 22-Sep-2012 pjd

Use O_CLOEXEC for open instead of separate fcntl(2) call.


# 236388 01-Jun-2012 dim

Make devd build with libc++.

MFC after: 3 days


# 229702 06-Jan-2012 glebius

Fix build.


# 226775 26-Oct-2011 hrs

- Add support for a "!" character in regex matching in devd(8). It inverts
the logic (true/false) of the matching.

- Add "!usbus[0-9]+" to IFNET ATTACH notification handler in the default
devd.conf to prevent rc.d/netif from running when usbus[0-9]+ is attached.

Reviewed by: imp


# 215607 21-Nov-2010 kevlo

Fix missing closedir()

Reviewed by: imp


# 213646 09-Oct-2010 imp

Allow the kernel to generate more spacy things and still have devd
cope. Skip multiple spaces in a few contexts.

PR: 96854
Submitted by: Shin'ya Kumabuchi
MFC after: 1 week


# 210610 29-Jul-2010 lulf

- Avoid calling the copy constructor when it is not necessary.


# 210609 29-Jul-2010 lulf

- Remove unused instance of string.


# 209583 29-Jun-2010 imp

Expand system into my_system, and add the necessary tidyness that we
need. Close the pidfile. Then close all descriptors >= 3 to avoid
information leakage to children.

This solves the problem of not being able to restart devd when you
have, for example, a dhclient forked to configure your network...

MFC after: 3 days


# 186078 14-Dec-2008 phk

Send all debug to stderr.


# 162388 17-Sep-2006 ru

Add -f option to program's usage(), fix manpage's SYNOPSIS.


# 157746 14-Apr-2006 maxim

o Yacc's lineno variable holds a total number of parsed lines.
Reset it to 1 for each devd config file so if the parser finds
a syntax error devd(8) will report a correct line number.

Submitted by: Niki Denev
MFC after: 2 weeks


# 155073 30-Jan-2006 pjd

Use pidfile(3).

OK'ed by: imp


# 154109 08-Jan-2006 imp

It was always intended that regular expression matching be case
insensitive. Make it so.


# 152770 24-Nov-2005 jkoshy

Add a -f configfile option to devd(8), based on a patch submitted by
Wojciech A. Koszek.

Submitted by: Wojciech A. Koszek <dunstan@freebsd.czest.pl>


# 152406 14-Nov-2005 bland

Reuse delete_and_clear() template helper.

Approved by: imp


# 151486 19-Oct-2005 brooks

Make devd WARNS=4 clean and bump WARNS accordingly. This will insure
that future variable shadowing bugs don't compile.

Reviewed by: imp
Compiled on: alpha i386 sparc64


# 151480 19-Oct-2005 imp

As pointed out on current@, we don't want to declare a variable in a scope
that just uses the variable and throws it away.

This should fix the subsystem keyword wrt media-type.

MFC After: 2 days


# 150949 04-Oct-2005 imp

media-type predicate is used in contexts where device-name is undefined.
In those contexted, use subsystem instead.

# This causes dhclient to run again when I plug in my ethernet cable to
# my fxp card in my laptop.


# 147973 13-Jul-2005 marcus

* Open permissions on /var/run/devd.pipe so that any user can read devd events
from this socket
* Enable non-blocking I/O on devd.pipe to keep clients from wedging devd.
If a write(2) on devd.pipe would block, the client in question will be
removed [1]

Requested by: rwatson [1]
Approved by: imp


# 147972 13-Jul-2005 marcus

Replace fch{mod,own} with straight ch{mod,own} as the former cannot be used
on socket file descriptors.

Reviewed by: secteam (cperciva)
Approved by: imp


# 147874 10-Jul-2005 imp

Add the ability to match the on a media type of the device in question.

Submitted by: sam
Approved by: re (scottl)


# 146306 16-May-2005 imp

Ignore sigpipe so we can properly detach clients to the pipe.

Submitted by: Fredrik Lindberg


# 145218 18-Apr-2005 imp

Fix parsing of nomatch events.
minor debug fix.


# 141611 10-Feb-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


# 131397 01-Jul-2004 imp

Create a unix domain socket and write to it all the events that come
in over the socket.


# 121487 24-Oct-2003 imp

Parse the ! lines that will soon be coming from the kernel. These are
a generalized notification mechanism for subsystems wishing to report
events.

Revieded by: njl

# The kernel side seems like it might be causing panics for me, but should
# be forthcoming shortly.


# 117944 23-Jul-2003 imp

Remove old workaround


# 117246 04-Jul-2003 imp

Drop the pid file after we call the final daemon call. w/o -n would
give the wrong pid.

Submitted by: ru and Lukas Ertl
PR: 54113


# 114541 02-May-2003 imp

sysctlbyname takes a size_t as its 5th argument, not a pointer.
However, since NULL was used, and this is C++, this error went
undetected until g++ 3.3 somehow managed to whine about it.

Reported by: obrien


# 114086 26-Apr-2003 imp

Create a new C++ header file called devd.hh which has all the class
definitions in it. Begin to document the classes that we use, and how
they interrelate (using comments that I can use with doxygen to
automatically generate docs with).


# 114084 26-Apr-2003 imp

Update to use is_id_char() in the last patch. I should have done this
before the last commit.


# 114081 26-Apr-2003 imp

Make better use of the string type when parsing things. This switches
expand one from using a fixed buffer to using a string which
dynamically allocates these things.

Submitted by: green@ (against an earlier version of devd)
Ignored for too long by: imp


# 114000 25-Apr-2003 imp

Change default to be 'process all events before calling daemon.'

Also, put a small work around into devd to prevent a hang on boot this
would cause because select used to return 2 rather than 0 for no
evetnts due to a bug I fixed a few days ago in subr_bus.c. I'll
remove this workaround May 7th. You have until then to upgrade your
kernel if you want to run a new devd with an older kernel.


# 113805 21-Apr-2003 imp

Kill debug printf that crept in my last commit


# 113790 21-Apr-2003 imp

Implement a two new flags, and change the meaning of another one.
'd': now means don't do daemon().
'D': Debug
'n': Don't wait to process all pending events before calling daemon.

In the past, devd would call daemon immediately. However, this causes
a race. If anything in the boot process depends on configuring the
devices configured by devd, maybe they would be configured in time,
maybe not. Now we don't call daemon until all pending events are
processed, unless -n is specified.

# -n is actually the default for a while due to the select(2) bug in devctl
# that I just fixed to give people a chance to upgrade.


# 113787 21-Apr-2003 imp

Put an anti-foot-shooting measure in place. Set hw.bus.devctl_disable
to 0 when we startup. Print a warning in this case. This allows
people that are playing with devd by hand to have something happen.
Otherwise, it appears that devd isn't working because /dev/devctl is
disabled and producing no events.

Suggested by: peter on irc a long time ago.


# 113785 21-Apr-2003 imp

o Skip white space between variables better. This makes
'a="b" c="d" at loc=1 on busN' properly set 'c' and process the rest of
the stirng. Before it would ignore everything after variable 'a'.
o Parse nomatch and other events differently. They are more different
than the code allowed for, so we weren't properly parsing nomatch
events. It appears this fixes some of the demand loading issues that
I was having with devd.

Noticed by: Gary Palmer


# 113782 21-Apr-2003 imp

devd.conf already has the examples in the todo list


# 108799 06-Jan-2003 imp

Terminate the usage message with \n.

Submitted by: joe


# 108783 06-Jan-2003 imp

MFp4: make it work

o Expand variables correctly.
o Set variables for each event.
o rewrite event loop to execute the commands in the config file, rather
than the hard wired generic command
o better(?) debug when running -d
o sort vectors of actions so that we just have to search for the first
one to match rather than the best one that matches.
o better attempts to clear all resources used on 'restart'
o Remove now bogus comments

MFC After: 1 centiyear


# 108014 18-Dec-2002 imp

Latest snapshot of devd. This one adds re-matching and string
expansion.


# 107665 07-Dec-2002 imp

MFp4 (imp_freebsd branch): snapshot of devd work:
o improve parsing and lexing
o create data structures based on the parsed file now.
o Still need to rewrite main loop and add regex (still uses hard coded
devd-generic)
o minor man page updates.

# There should be one more commit before rc2

Approved by: re (blanket)