index.html (17421B)
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 - skarnet's small supervision suite</title> 7 <meta name="Description" content="s6 - skarnet's small supervision suite" /> 8 <meta name="Keywords" content="s6 unix administration root pipe laurent bercot ska skarnet supervision runit" /> 9 <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> --> 10 </head> 11 <body> 12 13 <p> 14 <a href="//skarnet.org/software/">Software</a><br /> 15 <a href="//skarnet.org/">skarnet.org</a> 16 </p> 17 18 <h1> s6 </h1> 19 20 <h2> What is it ? </h2> 21 22 <p> 23 s6 is a small suite of programs for UNIX, designed to allow process supervision 24 (a.k.a service supervision), 25 in the line of <a href="https://cr.yp.to/daemontools.html">daemontools</a> 26 and <a href="http://smarden.org/runit/">runit</a>, as well as various 27 operations on processes and daemons. It is meant to be a toolbox for 28 low-level process and service administration, providing different sets of 29 independent tools that can be used within or without the framework, and 30 that can be assembled together to achieve powerful functionality with 31 a very small amount of code. 32 </p> 33 34 <p> 35 Examples of things you can do by assembling together several programs 36 provided by s6 - besides process supervision: 37 </p> 38 39 <ul> 40 <li> <a href="https://en.wikipedia.org/wiki/Syslog">syslogd</a> functionality, 41 using much less resources than the traditional syslogd. </li> 42 <li> Reliable service readiness notification, which is the basis for 43 service dependency management. </li> 44 <li> Controlled privileged gain as with 45 <a href="https://en.wikipedia.org/wiki/Sudo">sudo</a>, without using 46 any suid programs. </li> 47 <li> The useful parts of 48 <a href="https://0pointer.net/blog/projects/socket-activation.html">socket 49 activation</a><sup><a href="#fn1" id="r1">[1]</a></sup> 50 without having to change application code or link servers 51 against any specific library, and without having to switch to any 52 specific init system. </li> 53 </ul> 54 55 <p> 56 The s6 documentation tries to be complete and self-contained; however, 57 if you have never heard of process supervision before, you might be 58 confused at first. See the <a href="#related">related resources</a> section 59 below for pointers to more resources, and earlier approaches to process 60 supervision that might help you understand the basics. 61 </p> 62 63 <hr /> 64 65 <ul> 66 <li> A <a href="overview.html">high-level overview</a> of s6 </li> 67 <li> <a href="why.html">Why another supervision suite?</a> Isn't <a href="http://smarden.org/runit/">runit</a> good enough?</li> 68 <li> What is <a href="ftrig.html">instant notification</a>? What does the 69 <a href="libs6/ftrigr.html">ftrigr library</a> do exactly?</li> 70 <li> How to run an s6-svscan-based supervision tree <a href="s6-svscan-not-1.html">without replacing init</a> </li> 71 <li> How to <a href="s6-svscan-1.html">replace init</a> </li> 72 <li> How to perform <a href="socket-activation.html">socket activation 73 with s6</a> </li> 74 </ul> 75 76 <hr /> 77 78 <h2> Installation </h2> 79 80 <h3> Requirements </h3> 81 82 <ul> 83 <li> A POSIX-compliant system with a standard C development environment </li> 84 <li> GNU make, version 3.81 or later </li> 85 <li> <a href="//skarnet.org/software/skalibs/">skalibs</a> version 86 2.14.1.0 or later. It's a build-time requirement. It's also a run-time 87 requirement if you link against the shared version of the skalibs 88 library. </li> 89 <li> (Optional, but really recommended for full functionality): 90 <a href="//skarnet.org/software/execline/">execline</a> version 91 2.9.4.0 or later. When s6 is built with execline support (which is the default), 92 execline is a build-time requirement, and also a run-time requirement for 93 certain binaries that spawn scripts interpreted with 94 <a href="//skarnet.org/software/execline/execlineb.html">execlineb</a>. </li> 95 </ul> 96 97 <p> 98 The following optional dependencies are also supported: 99 </p> 100 101 <ul> 102 <li> If you're using <a href="https://www.musl-libc.org/">musl</a> and 103 want nsswitch-like functionality: 104 <a href="//skarnet.org/software/nsss/">nsss</a> version 105 0.2.0.4 or later (build-time and boot-time) </li> 106 </ul> 107 108 <h3> Licensing </h3> 109 110 <p> 111 s6 is free software. It is available under the 112 <a href="https://opensource.org/licenses/ISC">ISC license</a>. 113 </p> 114 115 <h3> Download </h3> 116 117 <ul> 118 <li> The current released version of s6 is <a href="s6-2.12.0.3.tar.gz">2.12.0.3</a>. </li> 119 <li> Alternatively, you can checkout a copy of the 120 <a href="//git.skarnet.org/cgi-bin/cgit.cgi/s6/">s6 121 git repository</a>: 122 <pre> git clone git://git.skarnet.org/s6 </pre> </li> 123 <li> There's also a 124 <a href="https://github.com/skarnet/s6">GitHub mirror</a> 125 of the s6 git repository. </li> 126 </ul> 127 128 <h3> Compilation </h3> 129 130 <ul> 131 <li> See the enclosed INSTALL file for installation details. </li> 132 </ul> 133 134 <h3> Upgrade notes </h3> 135 136 <ul> 137 <li> <a href="upgrade.html">This page</a> lists the differences to be aware of between 138 the previous versions of s6 and the current one. </li> 139 </ul> 140 141 <hr /> 142 143 <h2> Reference </h2> 144 145 <p> 146 If you prefer to read this documentation as man pages, it is now possible! 147 There is a <a href="https://github.com/flexibeast/s6-man-pages">project</a> that 148 ports the s6 documentation to a set of man pages. 149 </p> 150 151 <h3> Commands </h3> 152 153 <p> 154 All these commands exit 111 if they encounter a temporary error, and 155 100 if they encounter a permanent error - such as a misuse. They exit 156 127 if they're trying to execute into a program and cannot find it, and 157 126 if they fail to execute into a program for another reason. 158 Short-lived commands exit 0 on success. 159 </p> 160 161 <h4> Supervision system </h4> 162 163 <p> 164 <a href="s6-svscan.html">s6-svscan</a> and <a href="s6-supervise.html">s6-supervise</a> 165 are the long-lived processes maintaining the supervision tree. Other programs are 166 a user interface to control those processes and monitor service states. 167 </p> 168 169 <ul> 170 <li><a href="s6-svscan.html">The <tt>s6-svscan</tt> program</a></li> 171 <li><a href="s6-svscanctl.html">The <tt>s6-svscanctl</tt> program</a></li> 172 <li><a href="s6-supervise.html">The <tt>s6-supervise</tt> program</a></li> 173 <li><a href="s6-svc.html">The <tt>s6-svc</tt> program</a></li> 174 <li><a href="s6-svok.html">The <tt>s6-svok</tt> program</a></li> 175 <li><a href="s6-svstat.html">The <tt>s6-svstat</tt> program</a></li> 176 <li><a href="s6-svperms.html">The <tt>s6-svperms</tt> program</a></li> 177 <li><a href="s6-svlink.html">The <tt>s6-svlink</tt> program</a></li> 178 <li><a href="s6-svunlink.html">The <tt>s6-svunlink</tt> program</a></li> 179 <li><a href="s6-svwait.html">The <tt>s6-svwait</tt> program</a></li> 180 <li><a href="s6-svlisten1.html">The <tt>s6-svlisten1</tt> program</a></li> 181 <li><a href="s6-svlisten.html">The <tt>s6-svlisten</tt> program</a></li> 182 <li><a href="s6-notifyoncheck.html">The <tt>s6-notifyoncheck</tt> program</a></li> 183 <li><a href="s6-svdt.html">The <tt>s6-svdt</tt> program</a></li> 184 <li><a href="s6-svdt-clear.html">The <tt>s6-svdt-clear</tt> program</a></li> 185 <li><a href="s6-permafailon.html">The <tt>s6-permafailon</tt> program</a></li> 186 </ul> 187 188 <h4> Daemontools-like utilities </h4> 189 190 <p> 191 These programs are a rewrite of the corresponding utilities from 192 <a href="https://cr.yp.to/daemontools.html">daemontools</a>, with 193 a few extras. 194 </p> 195 196 <ul> 197 <li><a href="s6-envdir.html">The <tt>s6-envdir</tt> program</a></li> 198 <li><a href="s6-envuidgid.html">The <tt>s6-envuidgid</tt> program</a></li> 199 <li><a href="s6-fghack.html">The <tt>s6-fghack</tt> program</a></li> 200 <li><a href="s6-setsid.html">The <tt>s6-setsid</tt> program</a></li> 201 <li><a href="s6-setuidgid.html">The <tt>s6-setuidgid</tt> program</a></li> 202 <li><a href="s6-applyuidgid.html">The <tt>s6-applyuidgid</tt> program</a></li> 203 <li><a href="s6-softlimit.html">The <tt>s6-softlimit</tt> program</a></li> 204 <li><a href="s6-tai64n.html">The <tt>s6-tai64n</tt> program</a></li> 205 <li><a href="s6-tai64nlocal.html">The <tt>s6-tai64nlocal</tt> program</a></li> 206 </ul> 207 208 <h4> Fifodir management, notification and subscription </h4> 209 210 <p> 211 These programs are a clean rewrite of the obsolete "pipe-tools" package; they 212 are now based on a properly designed notification library. 213 They provide a command-line interface to 214 <a href="ftrig.html#notification">inter-process notification and 215 synchronization</a>. 216 </p> 217 218 <ul> 219 <li><a href="s6-mkfifodir.html">The <tt>s6-mkfifodir</tt> program</a></li> 220 <li><a href="s6-cleanfifodir.html">The <tt>s6-cleanfifodir</tt> program</a></li> 221 </ul> 222 <ul> 223 <li><a href="s6-ftrig-notify.html">The <tt>s6-ftrig-notify</tt> program</a></li> 224 </ul> 225 <ul> 226 <li><a href="s6-ftrig-wait.html">The <tt>s6-ftrig-wait</tt> program</a></li> 227 <li><a href="s6-ftrig-listen1.html">The <tt>s6-ftrig-listen1</tt> program</a></li> 228 <li><a href="s6-ftrig-listen.html">The <tt>s6-ftrig-listen</tt> program</a></li> 229 </ul> 230 <ul> 231 <li><a href="libs6/s6-ftrigrd.html">The <tt>s6-ftrigrd</tt> internal program</a></li> 232 </ul> 233 234 <h4> Local service management and access control </h4> 235 236 <ul> 237 <li><a href="s6-ipcclient.html">The <tt>s6-ipcclient</tt> program</a></li> 238 <li><a href="s6-ipcserver.html">The <tt>s6-ipcserver</tt> program</a></li> 239 <li><a href="s6-ipcserver-socketbinder.html">The <tt>s6-ipcserver-socketbinder</tt> program</a></li> 240 <li><a href="s6-ipcserverd.html">The <tt>s6-ipcserverd</tt> program</a></li> 241 <li><a href="s6-ioconnect.html">The <tt>s6-ioconnect</tt> program</a></li> 242 </ul> 243 <ul> 244 <li><a href="s6-ipcserver-access.html">The <tt>s6-ipcserver-access</tt> program</a></li> 245 <li><a href="s6-connlimit.html">The <tt>s6-connlimit</tt> program</a></li> 246 </ul> 247 <ul> 248 <li><a href="s6-accessrules-cdb-from-fs.html">The <tt>s6-accessrules-cdb-from-fs</tt> program</a></li> 249 <li><a href="s6-accessrules-fs-from-cdb.html">The <tt>s6-accessrules-fs-from-cdb</tt> program</a></li> 250 </ul> 251 252 <h4> suidless privilege gain </h4> 253 254 <ul> 255 <li><a href="s6-sudo.html">The <tt>s6-sudo</tt> program</a></li> 256 <li><a href="s6-sudoc.html">The <tt>s6-sudoc</tt> program</a></li> 257 <li><a href="s6-sudod.html">The <tt>s6-sudod</tt> program</a></li> 258 </ul> 259 260 <h4> Logging </h4> 261 262 <ul> 263 <li><a href="s6-log.html">The <tt>s6-log</tt> program</a></li> 264 <li><a href="s6-socklog.html">The <tt>s6-socklog</tt> program</a></li> 265 <li><a href="ucspilogd.html">The <tt>ucspilogd</tt> program</a></li> 266 </ul> 267 268 <h4> Management of user supervision trees </h4> 269 270 <ul> 271 <li><a href="s6-usertree-maker.html">The <tt>s6-usertree-maker</tt> program</a></li> 272 </ul> 273 274 <h4> Management of dynamic instances </h4> 275 276 <ul> 277 <li>An <a href="instances.html">overview</a> of dynamic instantiation in s6</li> 278 <li><a href="s6-instance-maker.html">The <tt>s6-instance-maker</tt> program</a></li> 279 <li><a href="s6-instance-create.html">The <tt>s6-instance-create</tt> program</a></li> 280 <li><a href="s6-instance-delete.html">The <tt>s6-instance-delete</tt> program</a></li> 281 <li><a href="s6-instance-control.html">The <tt>s6-instance-control</tt> program</a></li> 282 <li><a href="s6-instance-status.html">The <tt>s6-instance-status</tt> program</a></li> 283 <li><a href="s6-instance-list.html">The <tt>s6-instance-list</tt> program</a></li> 284 </ul> 285 286 <h4> fd-holding, a.k.a. the sensible part of socket activation </h4> 287 288 <ul> 289 <li><a href="s6-fdholder-daemon.html">The <tt>s6-fdholder-daemon</tt> program</a></li> 290 <li><a href="s6-fdholderd.html">The <tt>s6-fdholderd</tt> program</a></li> 291 </ul> 292 <ul> 293 <li><a href="s6-fdholder-store.html">The <tt>s6-fdholder-store</tt> program</a></li> 294 <li><a href="s6-fdholder-retrieve.html">The <tt>s6-fdholder-retrieve</tt> program</a></li> 295 <li><a href="s6-fdholder-delete.html">The <tt>s6-fdholder-delete</tt> program</a></li> 296 <li><a href="s6-fdholder-list.html">The <tt>s6-fdholder-list</tt> program</a></li> 297 <li><a href="s6-fdholder-getdump.html">The <tt>s6-fdholder-getdump</tt> program</a></li> 298 <li><a href="s6-fdholder-setdump.html">The <tt>s6-fdholder-setdump</tt> program</a></li> 299 <li><a href="s6-fdholder-transferdump.html">The <tt>s6-fdholder-transferdump</tt> program</a></li> 300 </ul> 301 302 <h3> Libraries </h3> 303 304 <ul> 305 <li><a href="libs6/"><tt>s6/s6.h</tt>, the main entry point</a></li> 306 <li><a href="libs6/ftrigw.html">The <tt>ftrigw</tt> library interface</a></li> 307 <li><a href="libs6/ftrigr.html">The <tt>ftrigr</tt> library interface</a></li> 308 <li><a href="libs6/lock.html">The <tt>s6lock</tt> library interface</a></li> 309 <li><a href="libs6/accessrules.html">The <tt>accessrules</tt> library interface</a></li> 310 <li><a href="libs6/fdholder.html">The <tt>s6-fdholder</tt> library interface</a></li> 311 </ul> 312 313 <h3> Definitions </h3> 314 315 <ul> 316 <li> What is a <a href="fifodir.html">fifodir</a></li> 317 <li> What is a <a href="servicedir.html">service directory</a></li> 318 <li> What is a <a href="scandir.html">scan directory</a></li> 319 <li> What is a <a href="localservice.html">local service</a></li> 320 <li> Why are the <a href="ftrig.html">libftrigw and libftrigr</a> needed </li> 321 </ul> 322 323 <hr /> 324 325 <a name="related"> 326 <h2> Related resources </h2> 327 </a> 328 329 <h3> s6 manual pages </h3> 330 331 <ul> 332 <li> <a href="https://github.com/flexibeast">flexibeast</a> is doing the ungrateful 333 but valuable work of 334 <a href="https://github.com/flexibeast/s6-man-pages">providing the s6 documentation 335 as a set of man pages</a>. </li> 336 </ul> 337 338 <h3> Other components for s6-based init systems </h3> 339 340 <ul> 341 <li> <a href="//skarnet.org/software/s6-linux-init/">s6-linux-init</a> 342 is a package to help you create a <tt>/sbin/init</tt> binary booting a 343 Linux system with s6-svscan as process 1. </li> 344 <li> <a href="https://github.com/just-containers/s6-overlay">s6-overlay</a> 345 is a project that automates integration of s6 into Docker images. </li> 346 <li> <a href="//skarnet.org/software/s6-rc/">s6-rc</a> is a 347 dependency-based service manager for s6. </li> 348 <li> <a href="https://jjacky.com/anopa">anopa</a> is another dependency-based 349 service manager for s6. </li> 350 </ul> 351 352 353 <h3> s6 discussion </h3> 354 355 <ul> 356 <li> <tt>s6</tt> is discussed on the 357 <a href="//skarnet.org/lists/#supervision">supervision</a> mailing-list. </li> 358 <li> There is a <tt>#s6</tt> IRC channel on OFTC. Sometimes people are there 359 and answer questions. </li> 360 </ul> 361 362 <h3> Similar work </h3> 363 364 <ul> 365 <li> <a href="https://cr.yp.to/daemontools.html">daemontools</a>, the pioneering 366 process supervision software suite. </li> 367 <li> <a href="https://untroubled.org/daemontools-encore/">daemontools-encore</a>, 368 a derived work from daemontools with enhancements. (Note that although s6 follows 369 the same naming scheme, the same general design, and many of the same architecture 370 choices as daemontools, it is still original work, sharing no code at all with 371 daemontools.) </li> 372 <li> <a href="http://smarden.org/runit/">runit</a>, a slightly different 373 approach to process supervision, with the same goals. </li> 374 <li> <a href="http://b0llix.net/perp/">perp</a>, yet another slightly different 375 approach to process supervision, also with the same goals. </li> 376 <li> <a href="http://jdebp.uk./Softwares/nosh/">nosh</a> 377 is another suite of system-level utilities with similarities in the design 378 and approach. It is written in C++, though, and is coded in quite a 379 different way than the previous items on this list. </li> 380 </ul> 381 382 <h3> Other init systems </h3> 383 384 <p> 385 (This list hasn't been updated in a long while. I'm keeping it for reference.) 386 </p> 387 388 <ul> 389 <li> Felix von Leitner's <a href="https://www.fefe.de/minit/">minit</a> is an 390 init system for Linux, with process supervision capabilities. </li> 391 <li> <a href="https://git.suckless.org/sinit">suckless init</a> is 392 considered by many as the smallest possible init. I disagree: suckless 393 init is incorrect, because it 394 has no supervision capabilities, and thus, killing all processes but init 395 can brick the machine. Nevertheless, suckless init, like many other 396 suckless projects, is a neat exercise in minimalism. </li> 397 <li> <a href="https://nongnu.org/sysvinit/">sysvinit</a> is the 398 traditional init system for Linux. </li> 399 <li> <a href="https://upstart.ubuntu.com/">Upstart</a> is a well-known init system 400 for Linux, with complete service management, that came with earlier versions of the Ubuntu 401 distribution. It is now deprecated.</li> 402 <li> <a href="//skarnet.org/software/systemd.html">systemd</a> is a problem in its own category. </li> 403 <li> The various BSD flavors have their own style of 404 <a href="https://www.freebsd.org/cgi/man.cgi?query=init&sektion=8&format=html">init</a>. </li> 405 <li> MacOS X has its own init spaghetti monster called 406 <a href="https://en.wikipedia.org/wiki/Launchd">launchd</a>. </li> 407 </ul> 408 409 <p> 410 All-in-one init systems generally feel complex and convoluted, and when most 411 people find out about the process supervision approach to init systems, they 412 usually find it much simpler. 413 <a href="s6-svscan-1.html#stages">There is a good reason for this.</a> 414 </p> 415 416 417 <h2> Miscellaneous </h2> 418 419 <h3> Why "s6" ? </h3> 420 421 <p> 422 <strong>s</strong>karnet.org's <strong>s</strong>mall and <strong>s</strong>ecure 423 <strong>s</strong>upervision <strong>s</strong>oftware <strong>s</strong>uite. 424 </p> 425 426 <p> 427 Also, s6 is a nice command name prefix to have: it identifies the origin of the 428 software, and it's short. Expect more use of s6- in future skarnet.org software 429 releases. And please avoid using that prefix for your own projects. 430 </p> 431 432 <h3> Footnotes </h3> 433 434 <section> 435 <p id="fn1"><a href="#r1"><sup>[1]</sup></a> 436 Take everything you read on that link with two or three salt shakers. 437 (This is true for anything written by the author of that document.) 438 </p> 439 </section> 440 441 </body> 442 </html>