66

Software

obarun.org

Module service creation

A module can be considered as an instantiated service. It works the same way as a service frontend file but allows the user/admin to configure a set of different kind of services before executing the enable process. Also, the set of services can be configured with the conjunction of a script called configure which can be made in any language.

This allows one to pre-configure a set of parameters or other services for special tasks without knowing the exact target of the module. The best example is the module for booting a machine. Each machine is different and the set of services need to be adaptable as much as possible for different kinds of machines during boot; e.g booting a container.

A module is defined with two elements:

The name of the frontend and the name of the directory must be the same. For example if the frontend is named /usr/share/66/service/foo@, the directory of the module must be /foo@.

Frontend file

The instantiated frontend service is written as any other instantiated service with its own specification—see the section [regex].

Module directory

The module directory can contain three sub-direcotories:

Any services that you need must be present inside the service or service@ directory. 66-enable only deals with these directories. If a service fooA has fooB as dependency, fooA and fooB must exist in the /<module_name>/service directory.

A word about the [regex] section @addservices field

You may need an existing frontend service file from your system to configure your module. Instead of redefining this frontend file, use this field. The 66-enable process will verbatim copy the frontend service file inside /usr/share/66/service/<module_name>/service or /usr/share/66/service/<module_name>/service@ module directory, depending on the type of service. This copying is made after all regex operations, and does not modify the frontend file at all.

A word about the [main] section with the module type

The valid fields in section [main] are:

All other fields from [main] section are not allowed.

66-enable module process creation

The name foo@ will be used in this explanation as a module name.

When you do 66-enable foo@system:

Environment variable passed to the script configure

At launch of the script configure, 66-enable passes the following variables to the environment: