summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/index.html6
-rw-r--r--doc/s6-devd.html4
-rw-r--r--doc/s6-uevent-listener.html99
-rw-r--r--doc/s6-uevent-spawner.html79
-rw-r--r--doc/upgrade.html11
5 files changed, 195 insertions, 4 deletions
diff --git a/doc/index.html b/doc/index.html
index a899be8..a0fe7d7 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -32,7 +32,7 @@
<li> A Linux-based system with a standard C development environment </li>
<li> GNU make, version 4.0 or later </li>
<li> <a href="http://skarnet.org/software/skalibs/">skalibs</a> version
-2.3.1.0 or later. It's a build-time requirement. It's also a run-time
+2.3.1.2 or later. It's a build-time requirement. It's also a run-time
requirement if you link against the shared version of the skalibs
library. </li>
</ul>
@@ -47,7 +47,7 @@ library. </li>
<h3> Download </h3>
<ul>
- <li> The current released version of s6-linux-utils is <a href="s6-linux-utils-2.0.1.0.tar.gz">2.0.1.0</a>. </li>
+ <li> The current released version of s6-linux-utils is <a href="s6-linux-utils-2.0.2.0.tar.gz">2.0.2.0</a>. </li>
<li> Alternatively, you can checkout a copy of the s6-linux-utils git repository:
<pre> git clone git://git.skarnet.org/s6-linux-utils </pre> </li>
</ul>
@@ -79,6 +79,8 @@ the previous versions of s6-linux-utils and the current one. </li>
<ul>
<li><a href="s6-chroot.html">The <tt>s6-chroot</tt> program</a></li>
<li><a href="s6-devd.html">The <tt>s6-devd</tt> program</a></li>
+<li><a href="s6-uevent-listener.html">The <tt>s6-uevent-listener</tt> program</a></li>
+<li><a href="s6-uevent-spawner.html">The <tt>s6-uevent-spawner</tt> program</a></li>
<li><a href="s6-freeramdisk.html">The <tt>s6-freeramdisk</tt> program</a></li>
<li><a href="s6-halt.html">The <tt>s6-halt</tt> program</a></li>
<li><a href="s6-hostname.html">The <tt>s6-hostname</tt> program</a></li>
diff --git a/doc/s6-devd.html b/doc/s6-devd.html
index 5ae6160..c67429a 100644
--- a/doc/s6-devd.html
+++ b/doc/s6-devd.html
@@ -36,7 +36,7 @@ hotplug events, as the <em>udev</em> program does. </li>
the event variables added to the environment, just as if <em>prog...</em>
had been registered in <tt>/proc/sys/kernel/hotplug</tt>. </li>
<li> However, unlike the kernel, s6-devd spawns the <em>prog...</em> helpers
-sequentially: it waits for an instance to finish before spawning another one. </li>
+sequentially: it waits for an instance to finish before spawning another one. </li>
<li> s6-devd is a long-lived program; it exits 0 when it receives a
SIGTERM. If a helper program is alive at that time, s6-devd waits for it to die
before exiting. </li>
@@ -68,7 +68,7 @@ fork and logs to stderr.) </li>
even if you are not using the <tt>-t</tt> option to s6-devd. Since helpers are
spawned sequentially, slow helpers can make events queue up and fill the netlink
kernel buffer. </li>
- <li> If you are using <a href="http://busybox.net/">busybox</a> and want a
+ <li> If you are using <a href="http://busybox.net/">busybox</a> and want a
minimal udev-style dynamic <tt>/dev</tt>
handling, <tt>/sbin/mdev</tt> is a suitable <em>prog...</em> helper. </li>
<li> The point of s6-devd is that it runs the helpers sequentially, so it solves
diff --git a/doc/s6-uevent-listener.html b/doc/s6-uevent-listener.html
new file mode 100644
index 0000000..9050e9f
--- /dev/null
+++ b/doc/s6-uevent-listener.html
@@ -0,0 +1,99 @@
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>s6-linux-utils: the s6-uevent-listener program</title>
+ <meta name="Description" content="s6-linux-utils: the s6-uevent-listener program" />
+ <meta name="Keywords" content="s6 linux administration root utilities devd mdev udev s6-uevent-listener uevent" />
+ <!-- <link rel="stylesheet" type="text/css" href="http://skarnet.org/default.css" /> -->
+ </head>
+<body>
+
+<p>
+<a href="index.html">s6-linux-utils</a><br />
+<a href="http://skarnet.org/software/">Software</a><br />
+<a href="http://skarnet.org/">skarnet.org</a>
+</p>
+
+<h1> The <tt>s6-uevent-listener</tt> program </h1>
+
+<p>
+<tt>s6-uevent-listener</tt> spawns a long-lived helper program.
+It then listens to the netlink interface for uevents (also called
+"hotplug" or "udev" events), and passes those events to the
+helper program's standard input, using a simple format.
+</p>
+
+<h2> Interface </h2>
+
+<pre>
+ s6-uevent-listener [ -v <em>verbosity</em> ] [ -b kbufsz ] <em>prog...</em>
+</pre>
+
+<ul>
+ <li> s6-uevent-listener spawns <em>prog...</em> with a pipe writing to
+<em>prog</em>' stdin. </li>
+ <li> s6-uevent-listener binds to the netlink interface and listens for
+hotplug events, as the <em>udev</em> program does. </li>
+ <li> It tranmits event information to <em>prog</em> via the pipe. </li>
+ <li> s6-uevent-listener, as well as <em>prog</em>, are long-lived programs.
+When it receives a SIGTERM, s6-uevent-listener stops listening; it will
+exit as soon as it has flushed its event queue to <em>prog</em>. </li>
+</ul>
+
+<h2> Options </h2>
+
+<ul>
+ <li> <tt>-v</tt>&nbsp;<em>verbosity</em>&nbsp;: be more or less verbose.
+Default verbosity is 1. 0 will only print fatal error messages, 3 will
+print warnings every time the netlink interface sends something
+unexpected. </li>
+ <li> <tt>-b</tt>&nbsp;<em>kbufsz</em>&nbsp;: try and reserve a kernel buffer of
+<em>kbufsz</em> bytes for the netlink queue. Too large a buffer wastes kernel memory;
+too small a buffer risks losing events. The default is 65536. </li>
+</ul>
+
+<h2> Protocol </h2>
+
+<ul>
+ <li> <em>prog</em> should read a series of events on its stdin, and exit
+on EOF. </li>
+ <li> An event is a series of null-terminated strings as they are sent by
+the kernel to the netlink; s6-uevent-listener adds a final empty string
+(i.e. an additional null character) to mark the end of the series. </li>
+ <li> The first string is a short description of the event; it normally
+contains the string "@/". Other strings after the first are of the form
+"VARIABLE=value", and describe the environment which a hotplug helper
+for the event (registered in <tt>/proc/sys/kernel/hotplug</tt>) would be
+spawned with. </li>
+ <li> Example (newlines added for clarity): <pre>
+add@/class/input/input9/mouse2\0
+ACTION=add\0
+DEVPATH=/class/input/input9/mouse2\0
+SUBSYSTEM=input\0
+SEQNUM=106\0
+PHYSDEVPATH=/devices/pci0000:00/0000:00:1d.1/usb2/2­2/2­2:1.0
+PHYSDEVBUS=usb\0
+PHYSDEVDRIVER=usbhid\0
+MAJOR=13\0
+MINOR=34\0
+\0 </pre> </li>
+</ul>
+
+<h2> Notes </h2>
+
+<ul>
+ <li> s6-uevent-listener is a daemon; it should be run under a proper supervision system such
+as <a href="http://skarnet.org/software/s6/">s6</a>. </li>
+<li> If you are running s6-uevent-listener, <em>prog...</em> should be the
+only program handling uevents, which means that
+<tt>/proc/sys/kernel/hotplug</tt> should be empty. </li>
+ <li> If you want the serialization benefit of the netlink, but still
+want to spawn a program such as <a href="http://busybox.net/">busybox</a>'s
+or <a href="http://landley.net/toybox/">toybox</a>'s <tt>mdev</tt>, use
+<tt><a href="s6-uevent-spawner.html">s6-uevent-spawner</a> mdev</tt> as
+s6-uevent-listener's <em>prog</em>. </li>
+</ul>
+
+</body>
+</html>
diff --git a/doc/s6-uevent-spawner.html b/doc/s6-uevent-spawner.html
new file mode 100644
index 0000000..e9be726
--- /dev/null
+++ b/doc/s6-uevent-spawner.html
@@ -0,0 +1,79 @@
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Language" content="en" />
+ <title>s6-linux-utils: the s6-uevent-spawner program</title>
+ <meta name="Description" content="s6-linux-utils: the s6-uevent-spawner program" />
+ <meta name="Keywords" content="s6 linux administration root utilities devd mdev udev hotplug" />
+ <!-- <link rel="stylesheet" type="text/css" href="http://skarnet.org/default.css" /> -->
+ </head>
+<body>
+
+<p>
+<a href="index.html">s6-linux-utils</a><br />
+<a href="http://skarnet.org/software/">Software</a><br />
+<a href="http://skarnet.org/">skarnet.org</a>
+</p>
+
+<h1> The <tt>s6-uevent-spawner</tt> program </h1>
+
+<p>
+<tt>s6-uevent-spawner</tt> listens to its standard input for
+netlink-style events, and launches a helper program for every event,
+similarly to what the hotplug interface does.
+</p>
+
+<p>
+ It is meant to be used together with
+<a href="s6-uevent-listener.html">s6-uevent-listener</a>.
+</p>
+
+<h2> Interface </h2>
+
+<pre>
+ s6-uevent-spawner [ -v <em>verbosity</em> ] [ -l <em>linevar</em> ] [ -t <em>l</em>:<em>t</em>:<em>k</em> ] <em>prog...</em>
+</pre>
+
+<ul>
+ <li> s6-uevent-spawner listens to its stdin for a series of strings
+representing kernel uevents, as formatted by
+<a href="s6-uevent-listener.html">s6-uevent-listener</a>. </li>
+ <li> For every event it reads, it spawns <em>prog...</em> with
+the event variables added to the environment, just as if <em>prog...</em>
+had been registered in <tt>/proc/sys/kernel/hotplug</tt>. However,
+it reads the events sequentially, and waits for a <em>prog</em> instance
+to finish before spawning another one. </li>
+ <li> When s6-uevent-spawner receives EOF: if an instance of
+<em>prog</em> is alive, it first waits for it to die. Then it exits
+0. </li>
+</ul>
+
+<h2> Options </h2>
+
+<ul>
+ <li> <tt>-v</tt>&nbsp;<em>verbosity</em>&nbsp;: be more or less verbose.
+Default verbosity is 1. 0 only prints fatal error messages. 3 is too much. </li>
+ <li> <tt>-l</tt> <em>linevar</em>&nbsp;: make the event description
+(i.e. the first string in the netlink message announcing the event)
+available in <em>prog</em> under the environment variable <em>linevar</em>.
+By default, this first string is ignored - it is not needed, all the
+event information is already in the other variables. </li>
+ <li> <tt>-t</tt> <em>l:t:k</em>&nbsp;: If <em>l</em>, <em>t</em> or <em>k</em> is
+specified, they specify timeouts; by default, they are infinite.
+If <em>prog...</em> is still alive after <em>l</em> milliseconds, s6-devd sends
+it a SIGTERM. Then, if <em>prog...</em> is still alive after <em>t</em> more
+milliseconds, s6-devd sends it a SIGKILL. Then, if <em>prog...</em> is still
+alive after <em>k</em> more milliseconds, s6-uevent-spawner yells and exits 99. </li>
+</ul>
+
+<h2> Notes </h2>
+
+<ul>
+ <li> The <em>prog...</em> helper should be very short-lived,
+even if you are not using the <tt>-t</tt> option to s6-devd. Since helpers are
+spawned sequentially, slow helpers can make events queue up and fill up
+buffers. </li>
+</ul>
+
+</body>
+</html>
diff --git a/doc/upgrade.html b/doc/upgrade.html
index b9dcfeb..847324d 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -17,6 +17,17 @@
<h1> What has changed in s6-linux-utils </h1>
+<h2> in 2.0.2.0 </h2>
+
+<ul>
+ <li> skalibs dependency bumped to 2.3.1.1 </li>
+ <li> New commands:
+<a href="s6-uevent-listener.html">s6-uevent-listener</a> and
+<a href="s6-uevent-spawner.html">s6-uevent-spawner</a> <li>
+ <li> <a href="s6-devd.html">s6-devd</a> is now a wrapper
+around those commands. </li>
+</ul>
+
<h2> in 2.0.1.0 </h2>
<ul>