s6-linux-utils
Software
skarnet.org
The s6-devd program
s6-devd listens to the netlink interface for udev events, and
launches a helper program for every event, similarly to what the hotplug
interface does.
Interface
s6-devd [ -q | -v ] [ -b kbufsz ] [ -l linevar ] [ -t l:t:k ] prog...
Options
- -q : be more quiet.
- -v : be more verbose.
- -b kbufsz : try and reserve a kernel buffer of
kbufsz bytes for the netlink queue. Too large a buffer wastes kernel memory;
too small a buffer risks losing events. The default is 65536.
- -l linevar : the short description of the
event, given by the kernel as the first string in the netlink message,
will be made available to prog under the environment variable
named linevar.
- -t l:t:k : If l, t or k is
specified, they specify timeouts; by default, they are infinite.
If prog... is still alive after l milliseconds, s6-devd sends
it a SIGTERM. Then, if prog... is still alive after t more
milliseconds, s6-devd sends it a SIGKILL. Then, if prog... is still
alive after k more milliseconds, s6-devd yells and exits 99.
Notes
- s6-devd is a daemon; it should be run under a proper supervision system such
as s6. The real long-lived
process is named s6-uevent-listener;
ir runs with the same pid as s6-devd.
- The prog... helper, on the other hand, should be very short-lived,
even if you are not using the -t option to s6-devd. Since helpers are
spawned sequentially, slow helpers can make events queue up and fill buffers
along the way.