Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docker_notes:init [2024-08-04 Sun wk31 13:22] – [s6 Service Driectories] baumkpdocker_notes:init [2024-10-13 Sun wk41 12:34] (current) – [References] baumkp
Line 26: Line 26:
 The s6-rc service directories are stored at ''%%/etc/s6-overlay/s6-rc.d/%%''. The s6-rc service directories are stored at ''%%/etc/s6-overlay/s6-rc.d/%%''.
 ^ sub-directory                            ^ Must  ^ Comment                                 | ^ sub-directory                            ^ Must  ^ Comment                                 |
-| ├── named                                | *1    | Service                                 | +| ├── <fs large>**named**</fs>                                | *1    | Service, longrun type, as required                               |   | 
-| │   ├── dependencies.d                   | *     List of dependent services            |   |+| │   ├── **dependencies.d**                   | *     Mandatory sub-directory with of dependent services as sub-directories |   |
 | │   │   ├── base                               | built in base services                |   | | │   │   ├── base                               | built in base services                |   |
 | │   │   └── pre_start_script                   | User pre start script (if required)     | | │   │   └── pre_start_script                   | User pre start script (if required)     |
-| │   ├── producer-for                     | *1    | file required for logging                  |   | +| │   ├── producer-for                     |*1  | file required for logging                  |   | 
-| │             └ file content: named-log  | *1    | file content with name of logging service |   | +| │             └ <code>        named-log</code>  | *1    | file content with name of logging service |   | 
-| │   ├── run                              | *     | File containing the service run script  |   | +| │   ├── run                              |* | File containing the service run script  |   | 
-| │             └ file content: <code>named-log</code>  | *1    | file content with name of logging service |   +| │             └ <code>        #!/command/execlineb -P 
-| │   ├── timeout-down                                                                 |   | +        fdmove -c 2 1 
-| │   ├── timeout-up                                                                   |   | +        /usr/sbin/named -f -4 </code>  |* | file content with service to run. Note service must run in foreground|   
-| │   └── type                                                                         |   |+| │   ├── timeout-down                          |optional file with timeout down, integer in milliseconds   | 
 +| │             └ <code>        180000</code>  | *1    | file content with name of logging service |   | 
 +| │   ├── timeout-up                             |optional file with timeout up, integer in milliseconds   | 
 +| │             └ <code>        30000</code>  | *1    | file content with name of logging service |   | 
 +| │   └── type                             |      |mandatory file containing service type, in this case longrun   | 
 +| │             └ <code>        longrun</code>  | *1    | file content with type of service |   |
 | ├── named-log                            |                                               | | ├── named-log                            |                                               |
 | │   ├── consumer-for                                                                   | | │   ├── consumer-for                                                                   |
Line 57: Line 62:
 ====s6 commands==== ====s6 commands====
 ++++Basic S6 commands:| ++++Basic S6 commands:|
- 
   *''s6-svstat /run/service/servicename'' or ''s6-svstat /run/s6-rc/servicedirs/deluged'' - check a daemon status, longrun only!   *''s6-svstat /run/service/servicename'' or ''s6-svstat /run/s6-rc/servicedirs/deluged'' - check a daemon status, longrun only!
   *''s6-rc -u change servicename'' - enable and start a daemon (up)   *''s6-rc -u change servicename'' - enable and start a daemon (up)
Line 70: Line 74:
 ++++ ++++
  
 +=====docker builtin basic init=====
 +In the docker run command the ''%%--init%%'' flag can be used to [[https://docs.docker.com/reference/cli/docker/container/run/#init|specify an init process]] is used.  This causes docker to use [[https://github.com/krallin/tini|tini]] as an init system on process 1, instead of the first docker command.  Tini is a very basic init system specifically for containers that reaps zombie processes and preforms signal forwarding.
 +
 +In docker compose add the directive ''init: true'' see example below:
 +++++docker-compose.yml snippet|
 +<code>services:                                                                                                           
 +    ntfy:
 +      image: binwiederhier/ntfy
 +      init: true
 +      container_name: ntfy </code>
 +++++
  
 +  *[[https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/|Docker and the PID 1 zombie reaping problem]]
 +  *[[https://github.com/docker-library/official-images?tab=readme-ov-file#init|docker library #init]]
 +  *[[https://www.baeldung.com/ops/docker-init-parameter|How to Use –init Parameter in Docker Run Command]]
 =====References===== =====References=====
-  *[[https://github.com/just-containers/s6-overlay| just-containers/s6-overlay]] (**Version 3.2.0.0** as of 2024-06-29, last checked 2024-07-27), note only a minor change since previous version+  *[[https://github.com/just-containers/s6-overlay| just-containers/s6-overlay]] (**Version 3.2.0.2** as of 2024-10-11, last checked 2024-10-13), note only a minor change since previous version
   *[[https://skarnet.org/software/s6-rc/s6-rc-compile.html|The s6-rc-compile program]] Describes the functionality of the S6-rc system   *[[https://skarnet.org/software/s6-rc/s6-rc-compile.html|The s6-rc-compile program]] Describes the functionality of the S6-rc system
   *[[https://forum.level1techs.com/t/easy-to-follow-beginner-guide-on-s6-starter-pack/178411|Easy to follow Beginner Guide on s6 Starter Pack]]   *[[https://forum.level1techs.com/t/easy-to-follow-beginner-guide-on-s6-starter-pack/178411|Easy to follow Beginner Guide on s6 Starter Pack]]