<metaname="Description"content="66: the frontend service file"/>
<metaname="Keywords"content="66 frontend service file supervision format key value ini"/>
<metaname="Description"content="Documentation for the frontend service file of the 66 system tools which is a better method to manage all your different services in a centralized way.">
<metaname="Keywords"content="66 frontend service file supervision format key value ini">
The <ahref="https://skarnet.org/software/s6">s6</a> and <ahref="https://skarnet.org/software/s6">s6-rc</a>
program handle and use different kind of services and files. If you have any
idea of what we talk about you can find informations<ahref="https://skarnet.org/software/s6/servicedir.html">here</a>
for what we call on Obarun <em>classic</em> service and<ahref="https://skarnet.org/software/s6-rc/s6-rc-compile.html">here</a>
for <em>oneshot</em>, <em>longrun</em>,<em>bundle</em> service. It can be complex to deal and
understand the link between those files and kind of services. So the 66
frontend was born to allow you to deal with all this kind of services with
one file.<br>
By default the 66 tools expect to find services files at <tt>/etc/66/service</tt>but it
can be changed at compile-time by giving the <tt>--with-service-path=<em>DIR</em></tt>
programs each handle and use several kinds of services and different files. If you're interested in the details
you should read<ahref="https://skarnet.org/software/s6/servicedir.html">the documentation for the s6 servicedir</a>
and also about <ahref="https://wiki.obarun.org/doku.php?id=s6services"><em>classic</em></a>,<ahref="https://skarnet.org/software/s6-rc/s6-rc-compile.html">
<em>oneshot</em>, <em>longrun</em> and<em>bundle</em> services</a> on Obarun. It is quite complex to
understand and manage the link between all those files and services. With the 66 tools
the frontend service file allows you to deal with all these different services in
a centralized manner in one single place.<br>
By default the 66 tools expect to find service files at <tt>/etc/66/service</tt>although this
can be changed at compile-time by passing the <tt>--with-service-path=<em>DIR</em></tt>
option to <tt>./configure.</tt></p>
<p>This file have a format of INI file with specific syntax on key field.
The name of the file correspond generally at the name of the daemon and do not
<p>The frontend service file has a format of INI with specific syntax on the key field.
The name of the file usually corresponds to the name of the daemon and does not
have any extension or prefix.
<p>The file is splitted into <em>section</em> which contain a <em>key value</em> pair.</p>
</p><p>The file is made of <em>sections</em> which can contain one or more <em>key value</em> pairs
where the <em>key</em> name can contain special characters like <em>'-' (hyphen)</em> or <em>'_' (low line)</em>
except the character <em>'@' (commercial at)</em> which is reserved.</p>
<p>The name can contain character like <em>'-'</em>, <em>'_'</em> and so
on except the <em>'@'</em> character which is case reserve.</p>
<h3>File name example</h3>
<h3>File name examples</h3>
<pre>/etc/66/service/dhcpcd</pre>
<pre>/etc/66/service/very_long_name</pre>
<h3>File contain example</h3>
<pre>[main]
@type = classic
@name = dhcpcd
@description = "dhcpcd daemon"
@user = ( root )
@max-death = 3
@options = ( log )
[start]
@build = auto
@execute = ( /usr/bin/dhcpcd -B )
[logger]
@build = auto
@backup = 2
@maxsize = 1000000
@timestamp = iso
[environment]
CONF=/etc/dhcpcd.conf</pre>
<p>In the general way the parser will not accept any empty <em>value</em>. If a
<em>key</em> is set, the <em>value</em> cannot be empty. Comment are allowed
using the character <tt>#</tt>. Empty line are also allowed.</p>
<p>All <em>key</em><strong>name</strong> are case reserve and cannot be
employ to suit your needs. However the <em>name</em> of the key should be
specific enough to avoid conflict with your needs.</p>
<p>Section can be declared in any order but a good practice is to declare
the <tt>[main]</tt> section at the first place. In this way the parser
will gain in time to treat the file.</p>
<h2>Section </h2>
<p>All sections need to be declared with the name set between '[]' bracket pair.
The name of the section do not contain uppercase and may not contain any other
character appart lowercase letter. An entire section can be commented placing
the <tt>#</tt> at the beginning of section name like this:</p>
<pre>#[stop]</pre>
<p>The frontend file use these valid section name: </p>
<p>The parser will not accept any empty <em>value</em>. If a
<em>key</em> is set, the <em>value</em> cannot be empty. Comments are allowed
using the number sign '#'. Empty lines are also allowed.<br>
<em>Key names</em> are <strong>case sensitive</strong> and <em>cannot be
modified</em>. Most names should be specific enough to avoid confusion.<br>
The sections can be declared in any order but as a good practice
the <tt>[main]</tt> section should be declared first. That way the parser
can read the file as fast as possible.</p>
<h2>Sections</h2>
<p>All sections need to be declared with the name written between square brackets '[]'
and must be of lowercase letters <strong>only</strong>. This means that special characters, uppercase letters and numbers are not allowed in the name of a section. An <em>entire</em> section can be commented out by placing
the number sign '#' in front of the opening square bracket like this:</p>
<pre> #[stop]</pre>
<p>The frontend service file allows the following section names: </p>
<p><em><strong>Note:</strong></em> The <em>funnel</em> feature of pipelining is not implemented yet.</p>
<br><hrstyle="border: 1px dashed #000000">
<li><h4>@flags</h4></li>
<p><tt>mandatory </tt> : no
</p><p><tt>syntax </tt> : bracket</p>
<p><tt>valid values </tt> :</p>
<ul>
<li><tt>nosetsid </tt> :
<h5>Corresponding name of file for s6-rc and s6 program : <em>nosetsid</em></h5>
<p>This will create the file <tt>nosetsid</tt>.</p>
<p>If such a file exists, the service will not be started as process group
and session leader; the service will be run in the same process group
as the supervisor of the service (a.k.a. s6-supervice). If no nosetsid
file exists, the service has its own process group and is started as a session leader.</p>
<li><tt>down </tt> :
<h5>Corresponding name of file for s6-rc and s6 program : <em>down</em></h5>
<p>This will create the file <tt>down</tt>.</p>
<p>If such a file exists, the default state of the service is considered down,
not up: the service will not automatically started until it receives a
66-start command. If no down file exists, the default state of the service is up. </p>
<h5>Corresponds to the file "<em>nosetsid</em>" of s6-rc and s6 programs</h5>
<p>This will create the file <tt>nosetsid</tt></p>
<p>Once this file was created the service will be run in the same process group
as the supervisor of the service <ahref="https://skarnet.org/software/s6/s6-supervise.html">(s6-supervise)</a>. Without this file the service will have its own process group and is started as a session leader.</p>
</li><li><tt>down </tt> :
<h5>Corresponds to the file "<em>down</em>" of s6-rc and s6 programs.</h5>
This will create the file <tt>down</tt><br><br>
Once this file was created the default state of the service will be considered <em>down</em>,
not <em>up</em>: the service will not automatically be started until it receives a
<tt>66-start</tt> command. Without this file the default state of the service will be <em>up</em> and started automatically.
</li>
</ul>
</li>
<hrstyle="border: 1px dashed #000000">
<br><hrstyle="border: 1px dashed #000000">
<li><h4>@notify</h4>
<h5>Corresponding name of file for s6-rc: <em>notification-fd</em></h5>
<p><tt>mandatory </tt> : no.
<p><tt>syntax </tt> : uint</p>
<p><tt>valid value </tt> :</p>
<li><h4>@notify</h4></li>
<h5>Corresponds to the file "<em>notification-fd</em>" of s6-rc programs.</h5>
<p><tt>mandatory </tt> : no
</p><p><tt>syntax </tt> : uint</p>
<p><tt>valid values </tt> :</p>
<ul>
<li>This will create the file <tt>notification-fd</tt>.
<p>If such a file exists, it means that the service supports
<li>Any valid number.
<p>This will create the file <tt>notification-fd</tt>.