s6

Mirror/fork of https://skarnet.org/software/s6/
git clone https://ccx.te2000.cz/git/s6
Log | Files | Refs | README | LICENSE

s6-fghack.html (1746B)


      1 <html>
      2   <head>
      3     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
      4     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      5     <meta http-equiv="Content-Language" content="en" />
      6     <title>s6: the s6-fghack program</title>
      7     <meta name="Description" content="s6: the s6-fghack program" />
      8     <meta name="Keywords" content="s6 command s6-fghack foreground program background hack anti-backgrounding tool" />
      9     <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
     10   </head>
     11 <body>
     12 
     13 <p>
     14 <a href="index.html">s6</a><br />
     15 <a href="//skarnet.org/software/">Software</a><br />
     16 <a href="//skarnet.org/">skarnet.org</a>
     17 </p>
     18 
     19 <h1> The s6-fghack program </h1>
     20 
     21 <p>
     22 s6-fghack is an anti-backgrounding tool.
     23 </p>
     24 
     25 <h2> Interface </h2>
     26 
     27 <pre>
     28      s6-fghack <em>prog...</em>
     29 </pre>
     30 
     31 <ul>
     32  <li> s6-fghack opens a lot of file descriptors (all writing to a single pipe). </li>
     33  <li> Then it spawns <em>prog...</em> as a child. </li>
     34  <li> If something gets written on one of those descriptors, it's a bug in <em>prog</em>.
     35 s6-fghack then complains and exits 102. </li>
     36  <li> Unless <em>prog...</em> goes out of its way to close descriptors it does not know about,
     37 s6-fghack is able to detect when <em>prog...</em> exits. It exits with an
     38 <a href="//skarnet.org/software/execline/exitcodes.html">approximation</a> of the same exit
     39 code. </li>
     40 </ul>
     41 
     42 <h2> Notes </h2>
     43 
     44 <p>
     45  s6-fghack is what it says: a hack. Ideally, you should never have to use it.
     46 It is only useful when you want to supervise a daemon that does not provide a
     47 "stay in the foreground" option; and even then, the right thing is to report
     48 this as a bug to the daemon author and have it fixed.
     49 </p>
     50 
     51 </body>
     52 </html>