66 is a collection of system tools built as a wrapper around the s6 supervision suite and s6-rc service manager created to make the implementation and manipulation of service files easier.

In Artix, the name suite66 is used instead of 66 in package names.

Quick start (troubleshooting)

If somehow your trees get deleted, to build boot and default trees from scratch, first set EDITOR to your favorite text editor. (Example: /bin/vi.) Then:

 export EDITOR=/bin/vi
 66-env -t boot [email protected]
 66-enable -t boot -F [email protected]
 66-tree -ncE default
 66-enable -t default acpid dhcpcd dbus logind syslog-ng    # add your desired services here
 66-all -t default up

The above method can be used to recreate them (for example, from a live ISO chroot).

Basics

This guide will be more of a crash course than an in depth guide on the usage of 66. For more information, please see the websites given in the section "Additional information".

Service directories for init scripts are located in:

 /etc/66/service

Modified init scripts, to avoid being overwritten by pkg updates, should be placed in:

 /etc/suite66/service

Trees

In 66, a tree is a collection of services. Trees exist to enable starting or stopping of several services at once, and to enable ordering. They roughly translate to bundles in s6. Two trees are set up by default: boot and default, with boot containing the essential system services that need to run first on boot, and default containing the non-essential services, running after boot.

If, for example, you want to create a tree named audio for your audio services, you could use the command

 66-tree -ncE audio

To have the above tree start after the tree default, run instead

 66-tree -nc -S default -E audio 

The option flags are:

 -n        create a new tree
 -c        set the tree as "current" tree
 -E        enable the tree
 -S PARENT start the tree after PARENT

You can enable/disable/remove a tree with

 66-tree OPTIONS TREE_NAME
 -E     Enable
 -D     Disable
 -R     Remove

Ordering of options is important. Refer to the manpage 66-tree(1) for more information.

Enabling/disabling services

When operating on a service, the tree must be explicitly given as a parameter, unless the tree is marked as "current". So, first decide which tree the service will go in. For this example we are enabling/disabling the service chrony in the tree default.

Enabling a service

 66-enable -t default chrony

Disabling a service

 66-disable -t default chrony

Configuring services

Services are configured using the command 66-env, which operates much like the command git commit. It opens up the configuration file in the text editor given in the environment variable EDITOR (or with the command-line parameter -e) and configures the service. For example:

 66-env -t default chrony

or, if EDITOR is not set and you wish to use /usr/bin/vim as editor,

 66-env -t default -e /usr/bin/vim chrony

Notes:

  • In order to configure a service, it must first be enabled in a tree.
  • Service configuration will be applied the next time the service is started. If the service was up before running 66-env, it needs to be restarted for changes to take effect.

Starting/stopping/restarting services

Having the same tree and service as in the previous sections, you can start/stop/restart the service using the following commands.

Starting a service

 66-start -t default chrony

Stopping a service

 66-stop -t default chrony

Restarting a service

 66-start -t default -r chrony

Note: In order to (re)start a service, it must first be enabled in a tree.

Starting all services in a tree

Start all services from the tree default:

 66-all -t default up

Stopping all services in a tree

Stop all services from the tree default:

 66-all -t default down

General 66 configuration

General 66 configuration is done by configuring the [email protected] service in the tree boot:

 66-env -t boot [email protected]    # if the EDITOR environment variable is set

or

 66-env -t boot -e /bin/vi [email protected]

as per above. This allows changing the timezone, console font, hostname, and so on, as well as features enabled on boot such as swap, LVM, BTRFS and more. After changing the configuration, it must be activated using:

 66-enable -t boot -F [email protected]

Note: Special care must be given when configuring [email protected], as it can lead to an unbootable system.

Checking service status

As in the other examples, we are using the tree default.

Checking status of all services in a tree

 66-intree -go contents default

The number before each service name is its PID. If it is 0, it means the service is not running.

Checking status of an individual service

 66-inservice -t default sshd

This will show various information about the service, including its current settings (environment), start script and last few lines from its log file.

/etc/local.d and /etc/rc.local

Unique feature of 66 in Artix is that it executes scripts from /etc/local.d/*.start and /etc/local.d/*.stop, like OpenRC. The service responsible for this feature is called local-rc and is placed in the tree boot by default. Scripts are run by programs elglob and forx in the glob order. The file /etc/local.d/local.start, installed by the package artix-branding-base, will in turn execute /etc/rc.local, a script traditionally run at boot.

After all of the above scripts are executed, as a more standard feature of 66, user-configurable (within the local-rc service) script is run, which defaults to /etc/66/rc.local.

User services

User services are placed in:

 $HOME/.66/service

66's user services are useful for services that do not need root privileges and are preferred to be run as a user. To be able to use this feature first install the suite66-scandir package

 pacman -S suite66-scandir

In order for a user to be able to run services, root must enable scandir for the user's service directory. For this example, user's username is artix. The following must then be run as root:

 66-enable -t TREE_NAME [email protected]
 66-start -t TREE_NAME [email protected]

Now a user can place their service files in $HOME/.66/service and run as a regular user:

 66-tree -cnE TREE_NAME
 66-enable -t TREE_NAME service
 66-start -t TREE_NAME service

This will only work if the frontend service file has the word user inside of the @user key in the section [main], for example:

 [main]
 @user = ( user )

Refer to frontend documentation for more information.

Switching inits

A note about going to another init and back to 66. Make sure all service files from previous tree still exists and run

 66-update

or you can delete the default tree: (The following three steps are only needed if you want or need to recreate the default tree)

 66-tree -RD default

and create the default tree again.

 66-tree -ncE default

Last step is to enable services you want to run in the default tree

 66-enable SERVICE(s)

Notes

If a service during boot crashes and causes tty to not show, tty12 should be available for diagnostic purposes and to allow service(s) to be fixed. It is activated by pressing the key combination Ctrl+Alt+F12.

Additional information

  1. https://web.obarun.org/software/66/latest/
  2. https://web.obarun.org/software/66-tools/