s6

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

s6-setsid.html (3206B)


      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-setsid program</title>
      7     <meta name="Description" content="s6: the s6-setsid program" />
      8     <meta name="Keywords" content="s6 command s6-setsid session leader setting" />
      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-setsid program </h1>
     20 
     21 <p>
     22  s6-setsid runs a program as a new session leader, or in a new
     23 foreground or background process group.
     24 </p>
     25 
     26 <h2> Interface </h2>
     27 
     28 <pre>
     29      s6-setsid [ -s | -b | -f | -g ] [ -i | -I | -q ] [ -d ctty ] <em>prog...</em>
     30 </pre>
     31 
     32 <ul>
     33  <li> s6-setsid creates a new session, or a new process group,
     34 and may make that process group the foreground process group,
     35 depending on the options it is run with. </li>
     36  <li> As session leader or process group leader, s6-setsid then
     37 executes into <em>prog...</em>. </li>
     38 </ul>
     39 
     40 <h2> Options </h2>
     41 
     42 <ul>
     43  <li> <tt>-s</tt>&nbsp;: session. s6-setsid will try and execute
     44 <em>prog</em> as a session leader. This is the default. </li>
     45  <li> <tt>-b</tt>&nbsp;: background process group. s6-setsid will
     46 not create a new session, but will create a new process group, and
     47 try and execute <em>prog</em> as the new process group leader. </li>
     48  <li> <tt>-f</tt>&nbsp;: foreground process group. s6-setsid will
     49 not create a new session, but will create a new process group and
     50 attach its session's controlling terminal to the new process group
     51 before executing <em>prog</em>. However, the new process group
     52 will likely be stopped, waiting for the former foreground process
     53 group to relinquish the controlling terminal, and will need to be
     54 sent a SIGCONT to resume. To avoid that, use the next option. </li>
     55  <li> <tt>-g</tt>&nbsp;: grab terminal. s6-setsid will
     56 not create a new session, but will create a new process group and
     57 attach its session's controlling terminal to the new process group
     58 before executing <em>prog</em>. It will forcefully grab the controlling
     59 terminal from the former foreground process group: a process
     60 belonging to that former foreground process group will be stopped if
     61 it attempts to read from or write to that terminal. </li>
     62  <li> <tt>-i</tt>&nbsp;: strict. If s6-setsid cannot perform the
     63 operations it needs, it will exit 111 with an error message. </li>
     64  <li> <tt>-I</tt>&nbsp;: loose. If s6-setsid cannot perform the operations,
     65 it will print a warning message, but exec into <em>prog</em> nonetheless.
     66 This is the default. </li>
     67  <li> <tt>-q</tt>&nbsp;: silent. s6-setsid will not print any warning
     68 message; it will exec into <em>prog</em> even if it cannot perform the
     69 operations. </li>
     70  <li> <tt>-d&nbsp;<em>ctty</em></tt>&nbsp;: assume file descriptor
     71 number <em>ctty</em> is
     72 the controlling terminal for the current session. Default is 0.
     73 This is only useful when used with the <tt>-f</tt> or
     74 <tt>-g</tt> options. </li>
     75 </ul>
     76 
     77 </body>
     78 </html>