<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Language" content="en" /> <title>The 66 Suite: 66-enable</title> <meta name="Description" content="Detailed documentation for the 66-enable command which is part of the 66 software suite" /> <meta name="Keywords" content="66 command 66-enable service supervision supervise enable service parse boot" /> <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> --> </head> <body> <p> <a href="index.html">66</a><br /> <a href="//obarun.org/">www.obarun.org</a> </p> <h1>66-enable</h1> <p> This command enables one ore more services inside a given <em>tree</em>. </p> <h2> Interface </h2> <pre> 66-enable [ -h ] [ -v <em>verbosity</em> ] [ -l <em>live</em> ] [ -t <em>tree</em> ] [ -f ] [ -S ] <em>service(s)</em> </pre> <p> This tool expects to find a corresponding <a href="frontend.html">frontend service file</a>, a directory name (see <a href="#directory">below</a>) or a <em>service</em> instance (see <a href="#instance">below</a>), by default at <tt>/etc/66/sysadmin/service</tt> or <tt>/etc/66/service</tt> in this order of precedence for root user and <tt>$HOME/.66/service</tt> or <tt>/etc/66/service</tt> in this order of precedence for a normal user. The default path can be changed at compile time by passing the <tt>--with-sys-service=<em>DIR</em></tt>, <tt>--with-packager-service=<em>DIR</em></tt> and <tt>--with-user-service=<em>DIR</em></tt> to <tt>./configure.</tt> It will run a parser on the frontend service file and write the result to the directory of the given <em>tree</em>—see <a href="66-tree.html">66-tree</a>. The <em>service</em> will then be available in the given <em>tree</em> for the next boot depending on the state of the <em>tree</em>. The targeted service(s) can also be started on the fly when enabling it with the <tt>-S</tt> option. </p> <p>Multiple <em>services</em> can be enabled by seperating their names with a space.</p> <h2> Options </h2> <ul> <li> <tt>-h </tt> : prints this help. </li> <li> <tt>-v <em>verbosity</em> </tt>: increases/decreases the verbosity of the command. <tt>1(Default)</tt>: Only print error messages. <tt>2</tt>: Also print warning messages. <tt>3</tt>: Also print debugging messages. </li> <li> <tt>-l <em>live</em></tt> : changes the supervision directory of <em>service</em> to <em>live</em>. By default this will be <tt>/run/66</tt>. The default can also be changed at compile time by passing the <tt>--livedir=<em>live</em></tt> option to <tt>./configure</tt>. An existing absolute path is expected and should be within a writable filesystem - likely a RAM filesystem—see <tt><a href="66-scandir.html">66-scandir</a></tt>. </li> <li> <tt>-t <em>tree</em></tt> : specifies the <em>tree</em> used to store the parsed <em>service</em> file. This option is mandatory except if a tree was marked as 'current'—see <a href="66-tree.html"><tt>66-tree</tt></a>. </li> <li> <tt>-f </tt> : reenables an already enabled <em>service</em> with the given options. This option will run again the process from the start and overwrite all existing files. </li> <li> <tt>-S </tt> : starts the <em>service</em> on the fly directly after enabling it. If the state of the <em>service</em> is already up, this option will have no effect unless the <tt>-f</tt> option is used to reload it. </li> </ul> <h2 id="dependencies">Dependency handling</h2> <p>For <em>services</em> of type <tt><em>'bundle'</em></tt> or <tt><em>'atomic'</em></tt> any existing dependency chain will be automatically resolved. It is unnecessary to manually define chained sets of dependencies. If FooA has a declared dependency on another service with the name FooB then FooB will be automatically enabled too when enabling FooA. This works recursively until all necessary dependencies are enabled.</p> <h2 id="directory">Directory name as <em>service</em></h2> <p>When choosing to make a directory be recognised as service the path of the directory must exist by default at <tt>/etc/66/sysadmin/service</tt>, <tt>/etc/66/service</tt> or <tt>$HOME/.66/service</tt> depending of the owner of the process and the option given at compile time. All <em>service</em> files found in this directory will be enabled. The directory can contain a mixed set of <tt><em>bundle</em></tt> and <tt><em>atomic</em></tt> services where some of those depend on each other. The directory option is not limited to these types though. Any available service type can be part of the set.</p> <p>A good example is a set of services for the boot process. To achieve this specific task a large number of <tt><em>oneshot</em></tt> services is used along with some <tt><em>classic</em></tt> services.</p> <p>The parser automatically resolves any existing dependency chain for the processed <em>services</em> just as it would for any regular service.</p> <p>(!) This option and its mechanics can be subject to change in future releases of the 66-enable tool.</p> <h2 id="instance">Instanced <em>service</em></h2> <p>An instanced <em>service</em> name from a service template can be passed as argument where the name of the <em>service</em> must end with a '@' (commercial at). —see <a href="frontend.html#instance"><tt>frontend service file</tt></a>.</p> <p>(!) The name of the template must be declared first immediately followed by the instance name as shown in the following example : <pre> 66-enable tty@tty1</pre></p> <p>Also an instanced <em>service</em> can be declared on the <em>@depends</em> field of the frontend service file.</p> <h2 id="configuration"><em>Service</em> configuration file</h2> <p>If the <a href="frontend.html#environment">environment</a> section is set on the frontend service file, the parse result process can be found by default at <tt>/etc/66/conf</tt> for the root user and <tt>$HOME/.66/conf</tt> for a normal user. The default path can be changed at compile time by passing the <tt>--with-sys-service-conf=<em>DIR</em></tt> for the root user and <tt>--with-user-service-conf=<em>DIR</em></tt> for a normal user.</p> </body> </html>