Chapter 6. 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 in /etc/sysconfig/tux. Refer to the section called Parameters in Chapter 3 for details.

For a user-space loadable module to be activated, you must create an empty file with the special permissions in docroot. The file must be owned by root with root as the group. For example, to use the demo.so user-space loadable module, you might do:
[root@m /]# ls -l /var/www/html/demo
-rwsrwS---    1 root     root            0 Sep  3 04:42 /var/www/html/demo
If TUX finds a URL object that has these special permissions, 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-1.0/TUXAPI-user.txt.