about summary refs log tree commit diff
path: root/doc/s6-fdholder-retrieve.html
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-01-26 22:26:57 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-01-26 22:26:57 +0000
commit8bffa1c19fd05f4f04dad4b5b98f85b94f23113c (patch)
treef4e25c3cdb7118db02a06c85b7862107a2074ba4 /doc/s6-fdholder-retrieve.html
parent49cb17940e403431566dc7b5a312624f14eb25d0 (diff)
downloads6-8bffa1c19fd05f4f04dad4b5b98f85b94f23113c.tar.gz
s6-8bffa1c19fd05f4f04dad4b5b98f85b94f23113c.tar.xz
s6-8bffa1c19fd05f4f04dad4b5b98f85b94f23113c.zip
- added s6-fdholder-delete(c)
 - small s6-fdholder-* fixes
 - s6-fdholder documentation (in review)
 - s6_svstatus_* bugfix (thanks Olivier Brunel)
Diffstat (limited to 'doc/s6-fdholder-retrieve.html')
-rw-r--r--doc/s6-fdholder-retrieve.html98
1 files changed, 98 insertions, 0 deletions
diff --git a/doc/s6-fdholder-retrieve.html b/doc/s6-fdholder-retrieve.html
new file mode 100644
index 0000000..5231051
--- /dev/null
+++ b/doc/s6-fdholder-retrieve.html
@@ -0,0 +1,98 @@
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>s6: the s6-fdholder-retrieve program</title>
+    <meta name="Description" content="s6: the s6-fdholder-retrieve program" />
+    <meta name="Keywords" content="s6 s6-fdholder fd-holding fd-holder fd retrieval unix socket activation" />
+    <!-- <link rel="stylesheet" type="text/css" href="http://skarnet.org/default.css" /> -->
+  </head>
+<body>
+
+<p>
+<a href="index.html">s6</a><br />
+<a href="http://skarnet.org/software/">Software</a><br />
+<a href="http://skarnet.org/">skarnet.org</a>
+</p>
+
+<h1> The <tt>s6-fdholder-retrieve</tt> program </h1>
+
+<p>
+<tt>s6-fdholder-retrieve</tt> connects to a
+<a href="s6-fdholderd.html">fd-holding daemon</a> listening on a
+Unix domain socket, and retrieves a file descriptor from that
+daemon, then executes a program with that file descriptor as the
+program's standard input.
+</p>
+
+<h2> Interface </h2>
+
+<pre>
+     s6-fdholder-retrieve [ -D ] [ -t <em>timeout</em> ] <em>path</em> <em>id</em> <em>prog...</em>
+</pre>
+
+<ul>
+ <li> s6-fdholder-retrieve executes into <tt><a href="s6-ipcclient.html">s6-ipcclient</a> <em>path</em>
+<a href="s6-fdholder-retrievec.html">s6-fdholder-retrievec</a> <em>id</em> <em>prog...</em></tt>.
+It does nothing else: it is just a convenience program.
+The <a href="s6-ipcclient.html">s6-ipcclient</a> program connects
+to a Unix socket at <em>path</em>, and the
+<a href="s6-fdholder-retrievec.html">s6-fdholder-retrievec</a> program
+gets the file descriptor identified by <em>id</em> over the socket. </li>
+ <li> It should be used to connect to a
+<a href="s6-fdholderd.html">s6-fdholderd</a> daemon, which will pass the
+file descriptor to the client over the <em>path</em> socket. </li>
+ <li> It executes into <em>prog...</em> with the retrieved file
+descriptor as <em>prog...</em>'s standard input. </li>
+</ul>
+
+<h2> Options </h2>
+
+<ul>
+ <li> <tt>-D</tt>&nbsp;: delete the file descriptor from the server's
+storage after retrieval. This option requires writing rights over the
+given identifier as well as reading rights: check the server's
+<a href="s6-fdholderd.html#configuration">configuration</a>. </li>
+ <li> <tt>-t&nbsp;<em>timeout</em></tt>&nbsp;: if the operation cannot be
+processed in <em>timeout</em> milliseconds, then fail with an error message.
+Communications with the server should be near-instant, so this option is
+only here to protect users against programming errors (connecting to the
+wrong socket, for instance). </li>
+</ul>
+
+<h2> Usage example </h2>
+
+<pre>
+   s6-fdholder-store /service/fdholderd/s MYSOCKET s6-ipcserverd cat
+</pre>
+
+<p>
+ will retrieve a file descriptor stored under the MYSOCKET identifier in
+the s6-fdholderd daemon listening on the <tt>/service/fdholderd/s</tt>
+socket, and execute into <tt>s6-ipcserverd cat</tt> with that file
+descriptor as stdin. In this case, if MYSOCKET referred to a Unix domain
+socket, <a href="s6-ipcserverd.html">s6-ipcserverd</a> will then accept
+client connections on it and spawn a <tt>cat</tt> program for every
+connection.
+</p>
+
+<h2> Notes </h2>
+
+<ul>
+ <li> s6-fdholder-retrieve really executes into <tt>s6-ipcclient
+s6-fdholder-retrievec
+<a href="http://skarnet.org/software/execline/fdclose.html">fdclose</a>
+6 fdclose 7 <em>prog...</em></tt>, so that <em>prog...</em> does not
+have a connection with the fd-holding daemon anymore. If you want to
+keep the server connection open for <em>prog...</em>, use
+<tt>s6-ipcclient s6-fdholder-retrievec</tt> manually. </li>
+ <li> To execute <em>prog</em> with the newly retrieved file descriptor
+as number <em>n</em> while preserving stdin, use the following construct:
+<tt>fdmove <em>n</em> 0 s6-fdholder-retrieve <em>path</em> <em>id</em>
+<a href="http://skarnet.org/software/execline/fdswap.html">fdswap</a>
+0 <em>n</em> <em>prog...</em></tt>. Be aware that <em>n</em>
+cannot be 6 or 7, internally used by s6-fdholder-retrieve. </li>
+</ul>
+
+</body>
+</html>