Skip to content

S6

s6 is a small suite of programs for UNIX, designed to allow process supervision (a.k.a service supervision), in the line of daemontools and runit, as well as various operations on processes and daemons. It is meant to be a toolbox for low-level process and service administration, providing different sets of independent tools that can be used within or without the framework, and that can be assembled together to achieve powerful functionality with a very small amount of code.

Overview

s6 is a collection of utilities revolving around process supervision and management, logging, and system initialization. This page is a high-level description of the different parts of s6.

At its core, s6 is a process supervision suite, like its ancestor daemontools and its close cousin runit.

s6-overlay

s6-overlay is an easy-to-install (just extract a tarball or two!) set of scripts and utilities allowing you to use existing Docker images while using s6 as a pid 1 for your container and process supervisor for your services.

s6-envdir

#!/usr/bin/with-contenv bash

Indeed, this is related, and very specific, to the s6-overlay architecture. This is a tool for using the s6 process supervisor inside of Docker containers.

In some more detail, Docker is otherwise not well-suited to running multiple services and daemons in the same container, and the general architecture of a supervisor is at odds with how Docker wants things. s6-overlay attempts to fix this, so that you can run services inside of a single Docker container.

As explained in the documentation, with-contenv is a wrapper which makes sure the argument is run with the environment variables specific to s6-overlay.

Concretely, it uses s6-envdir to load the environment from /var/run/s6/container_environment before executing its argument (in this case, bash).

Extra historical context, s6 is essentially a few minor (but important) improvements over runit, and runit is a supervision suite that really integrates the daemontools philosophy of service supervision into debian. And daemontools originated the idea of envdir

구글 번역 버전

실제로 이는 s6 오버레이 아키텍처와 관련이 있으며 매우 구체적입니다. Docker 컨테이너 내부에서 s6 프로세스 감독자를 사용하기 위한 도구입니다.

좀 더 자세히 설명하면 Docker는 동일한 컨테이너에서 여러 서비스와 데몬을 실행하는 데 적합하지 않으며 감독자의 일반적인 아키텍처는 Docker가 원하는 방식과 상충됩니다. s6-overlay는 이 문제를 해결하여 단일 Docker 컨테이너 내에서 서비스를 실행할 수 있도록 시도합니다.

문서에 설명된 대로 with-contenv는 s6-overlay와 관련된 환경 변수를 사용하여 인수가 실행되도록 하는 래퍼입니다.

구체적으로, s6-envdir을 사용하여 인수(이 경우 bash)를 실행하기 전에 /var/run/s6/container_environment에서 환경을 로드합니다.

추가 역사적 맥락에서 s6은 본질적으로 runit에 비해 몇 가지 사소하지만 중요한 개선 사항이며 runit은 서비스 감독에 대한 daemontools 철학을 데비안에 실제로 통합하는 감독 제품군입니다. 그리고 daemontools는 envdir이라는 아이디어를 창안했습니다.

See also

  • daemontools
  • runit

Favorite site