diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-05 22:26:11 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-05 22:26:11 +0000 |
commit | 90b12bd71bb9fc79a4640b9112c13ef529d0196a (patch) | |
tree | 523b3f4ee2969e7a729bab2ba749c4b924ae62af /doc/s6-notifywhenup.html | |
download | s6-90b12bd71bb9fc79a4640b9112c13ef529d0196a.tar.xz |
Initial commit
Diffstat (limited to 'doc/s6-notifywhenup.html')
-rw-r--r-- | doc/s6-notifywhenup.html | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/doc/s6-notifywhenup.html b/doc/s6-notifywhenup.html new file mode 100644 index 0000000..ad7ef8e --- /dev/null +++ b/doc/s6-notifywhenup.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: the s6-notifywhenup program</title> + <meta name="Description" content="s6: the s6-notifywhenup program" /> + <meta name="Keywords" content="s6 command s6-notifywhenup fifodir notification event notifier send service daemon ready" /> + <!-- <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 s6-notifywhenup program </h1> + +<p> +s6-notifywhenup launches a daemon while listening to a file descriptor, +and sends a 'U' event to a <a href="fifodir.html">fifodir</a> when it +receives something on that file descriptor. +</p> + +<p> +<a href="notifywhenup.html">This page</a> explains why this program is +needed. +</p> + +<h2> Interface </h2> + +<pre> + s6-notifywhenup [ -d <em>fd</em> ] [ -e <em>fifodir</em> ] [ -f ] [ -t <em>timeout</em> ] <em>prog...</em> +</pre> + +<ul> + <li> s6-notifywhenup forks and executes <em>prog...</em> as the +parent, with a pipe from <em>prog...</em>'s stdout to the child. </li> + <li> The child waits for EOF on the pipe. When it gets it, if there +have been other characters written before the EOF, it sends a 'U' +event to the <tt>./event</tt> fifodir. </li> + <li> The child exits 0. </li> +</ul> + +<h2> Options </h2> + +<ul> + <li> <tt>-d <em>fd</em></tt> : listen to +<em>prog</em>'s output on descriptor <em>fd</em>. The default is 1. </li> + <li> <tt>-e <em>fifodir</em></tt> : send a 'U' event to fifodir +<em>fifodir</em>. Default is <tt>./event</tt>. </li> + <li> <tt>-f</tt> : simple fork. Normally, s6-notifywhenup doubleforks, +in order to accommodate for a +<em>prog</em> that does not expect to have a child and avoid a +pending zombie. This option avoids the doublefork, but it should only be +set if <em>prog</em> reaps even children it doesn't know it has. </li> + <li> <tt>-t <em>timeout</em></tt> : if no EOF has been received +after <em>timeout</em> milliseconds, exit without sending the event. +Default is 0, meaning infinite. </li> +</ul> + +<h2> Notes </h2> + +<ul> + <li> s6-notifywhenup executes <em>prog...</em> as the parent in order +for <em>prog</em> to keep the same pid, which is vital for supervised +processes. </li> + <li> s6-notifywhenup can be used, for instance, with +<a href="http://skarnet.org/software/s6-networking/s6-tcpserver.html">s6-tcpserver</a> +and its <tt>-1</tt> option, so that reliable startup notification is +achieved. <tt>s6-notifywhenup -f s6-tcpserver -1 <em>args</em></tt> will +send a 'U' event to <tt>./event</tt> when s6-tcpserver is actually +listening to its network socket. </li> + <li> The <a href="s6-svwait.html">s6-svwait</a> program can be used +to wait for 'U' events. </li> +</ul> + +</body> +</html> |