summary refs log tree commit diff
path: root/doc/s6-devd.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/s6-devd.html')
-rw-r--r--doc/s6-devd.html80
1 files changed, 80 insertions, 0 deletions
diff --git a/doc/s6-devd.html b/doc/s6-devd.html
new file mode 100644
index 0000000..5ae6160
--- /dev/null
+++ b/doc/s6-devd.html
@@ -0,0 +1,80 @@
+<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-devd program</title>
+    <meta name="Description" content="s6-linux-utils: the s6-devd program" />
+    <meta name="Keywords" content="s6 linux administration root utilities devd mdev udev" />
+    <!-- <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-devd</tt> program </h1>
+
+<p>
+<tt>s6-devd</tt> listens to the netlink interface for udev events, and
+launches a helper program for every event, similarly to what the hotplug
+interface does.
+</p>
+
+<h2> Interface </h2>
+
+<pre>
+     s6-devd [ -q | -v ] [ -b kbufsz ] [ -t l:t:k ] <em>prog...</em>
+</pre>
+
+<ul>
+ <li> s6-devd binds to the netlink interface and listens for
+hotplug events, as the <em>udev</em> program does. </li>
+ <li> For every event it receives, 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>. </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>
+ <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>
+</ul>
+
+<h2> Options </h2>
+
+<ul>
+ <li> <tt>-q</tt>&nbsp;: be more quiet. </li>
+ <li> <tt>-v</tt>&nbsp;: be more verbose. </li>
+ <li> <tt>-b</tt> <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>
+ <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-devd yells and exits 99. </li>
+</ul>
+
+<h2> Notes </h2>
+
+<ul>
+ <li> s6-devd is a daemon; it should be run under a proper supervision system such
+as <a href="http://skarnet.org/software/s6/">s6</a>. (That is why it does not
+fork and logs to stderr.) </li>
+ <li> The <em>prog...</em> helper, on the other hand, 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 the netlink
+kernel buffer. </li>
+ <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
+the race condition that appears when helpers are run via the hotplug interface.
+When s6-devd is used, <tt>/proc/sys/kernel/hotplug</tt> should be empty. </li>
+</ul>
+
+</body>
+</html>