Chapter 5. User-space Loadable Modules

In addition to parts of TUX running in kernel-space, user-loadable modules can also be written for TUX.

Note

The API for the user-loadable modules is currently under development. This section of the documentation will be updated as the API becomes available.

User-space loadable modules are usually a single .c file and are compiled as a shared libraries as a .so file. There can be an unlimited number of user-space HTTP modules, and they can be compiled in a language of choice. They have full address space protection, can not crash the kernel, and are unpriviledged.

A list of user-space loadable TUX modules and their location must be specified with the TUXMODULES parameter in /etc/sysconfig/tux. Refer to the Section called Parameters in Chapter 3 for details.

Starting with TUX version 2.0.13 and kernel patch 2.4.2-P3, user-space loadable modules do not require special permissions to be activated. Instead, the module is specified using a common MIME type definition file. The user-space modules must end with the file extension .tux or .x and specified with the TUXMODULES parameter in /etc/sysconfig/tux. The file must be owned by root with root as the group and must be world-readable. It does not have to be executable. For example, to use the demo.tux user-space loadable module, you might have the following file:
[root@m /]# ls -l /var/www/html/demo.tux
-rw-rw-r--    1 root     root            0 Sep  3 04:42 /var/www/html/demo.tux
If TUX finds a URL object that has this MIME type, it searches the internal list of modules defined as TUXMODULES in /etc/sysconfig/tux. If there is a match, TUX sends the request to the user-space loadable module.

For further information about writing a TUX user-space loadable module, see the file /usr/share/doc/tux-<version>/TUXAPI-user.txt.