66

Software

obarun.org

66-tree

This command handles a directory containing a set of services.

Interface

    66-tree [ -h ] [ -z ] [ -v verbosity ] [ -l ] [ -n|R ] [ -a|d ] [ -c ] [ -S after_tree ] [ -E|D ] [ -C clone ] tree

66-tree will create, destroy, or modify a tree which dynamically handles services. 66-tree will handle the tree only for the user running the process (root/user). Any tree is completely independent from another. If you want to know what trees are currently available on the system use the 66-intree tool.

Exit codes

Options

Why trees?

The usefulness of having several trees with different services can be explained with a simplified example.

    Tree1 contains dhcpcd & ntpd
    Tree2 contains cups & nfs
    Tree3 contains xorg, notification-daemon, gvfsd & dbus

When you boot your machine and want to use it from console only, you don't care about xorg or cups, you only care about a working internet connection. So at the base you only have Tree1 enabled. At every boot this tree and all its services will now be automatically started. Then you need to print something but for this, you also need to start the nfs daemon because your document is on some other server. Normally you would need to start cups then start nfs. Using the concept of trees you start Tree2 and everything is available. When you have finished printing your awesome document instead of stopping the needed services one by one you simply stop the whole Tree2 and all its containing services are stopped automatically. This doesn't stop here. Now you want to see a video, you need a running X server and probably several other services. Tree3 was designed just for that.

Directories and files

(!) Caution: AVOID manipulating manually any directories and sub directories and their containing files of a tree. CORRUPTION and ERRORS may occur by doing so. The following details can help better understand the mechanics of the 66 tools. Nevertheless the 66 suite manages these paths dynamically and its tools like 66-enable, 66-disable, 66-start, 66-dbctl etc. will automatically search these directories to find information about a required service.

At creation time

When creating a new tree, by default it will be created at /var/lib/66/system/tree for root and at $HOME/.66/system/tree for any regular user.

The base name of the directory, namely /var/lib/66/ and $HOME/.66/ can be changed at compile time by passing the --with-system-dir=DIR option for root and the --with-user-dir=DIR option for any regular user to ./configure.

When enabling a service

By enabling a service its corresponding frontend service file is parsed and the result written to a sub directory of the tree's path called servicedirs/svc for classic services and servicedirs/db/source for bundle or atomic services.

As an example for root the resulting files would, by default, be found at /var/lib/66/system/tree/servicedirs/svc for services of type classic and at /var/lib/66/system/tree/servicedirs/db/source for any service of type bundle or atomic.

When enabling a whole tree

When you ask to start all services of the currently enabled tree at once with the 66-all tool, the directory /var/lib/66/system/tree/servicedirs/svc is opened and the command will start any service found inside of that directory.

For services of type bundle,module and atomic, instead of opening the directory /var/lib/66/system/tree/servicedirs/db/source, the corresponding compiled database found at /var/lib/66/system/tree/servicedirs/db/tree is used. The database found at this location is the result of an automatic use of the command s6-rc-compile when enabling such a service.