Introduction

The KServer is the process server provided by KHOMP for situations where more than one process needs to access the boards. The K3L programming API accesses the drivers, but only one process at a time can load it. This implies that in systems where multiple processes need to communicate with the board, some system for inter-process communication must exist.

In this context, the solution proposed by KHOMP was to provide a dynamic library with the same name and interface as the K3L API, named client API or K3L-C. This library, instead of communicating directly with the drivers, communicates with the KServer process, which passes the requests to K3L API library. Figure 1 shows the communication hierarchy for these components:


Figure 1 - Model of communication using the KServer.

Use the program

The default behavior of KServer is to start the boards when loaded (if they are not already started). When closed, the boards stay up and continue to generate clocks for the buses, speeding up the next system startup. The other details of the boot are detailed below.

Process control

To launch KServer, just enter the command line:

# kserver start

This will launch the process with the default options. To finalize it, just type:

# kserver stop

The command will wait until the process finishes. To restart, you can run the command:

# kserver restart

Which is equivalent to:

# kserver stop; kserver start

Parameters

The startup behavior of KServer can be changed using arguments in the command line:

These options should be passed after the command (start/restart), as shown below:

# kserver start -novoip -debug

Other arguments are also available for the command line:

Settings

To set parameters that will be permanently set, it is not necessary to use the command line arguments: default options may be defined by creating specific files within the directory "/etc/kserver".

The presence of these files will make the corresponding option to be used on boot. The file list is as follows:

Permissions

For any process to be able to use KServer services (via the client library), it is required that the process running the client library to belong in some way to the 'root' group in the operating system.

If this condition is not met, there are two alternatives:

  1. The user whose process needs to access the KServer services must be included in the 'root' group, using the tools available for this operating system (eg: usermod);
  2. The KServer processs may be configured via shm-group to create the intercommunication files using a particular group, chosen by the user, as shown below:

# echo my_group_name > /etc/kserver/shm-group

The contents of this should be the only group name, without any extra quotation marks, comments, or additional spaces.

For instance: to configure kserver with permissions to group asterisk, it can be done as follows:

# echo asterisk > /etc/kserver/shm-group

Identifying Problems

When loading the process for board management, the program kserver initializes a background service, redirecting all the error messages/warnings to the operating system log service (syslog), messages which are normally found in "/var/log/messages" (depending on machine configuration).

In this file, there can be found general, warning or error messages, which can be used to diagnose problems while loading the services. For example, in the messages below:

Jan 1 10:11:12 pbx kserver-daemon [123]: KHOMP - Server Process booting ...
Jan 1 10:11:12 pbx kserver-daemon [123]: Starting system (API K3L) ...
Jan 1 10:11:22 pbx kserver-daemon [123]: K3L 2.1 started successfully.
Jan 1 10:11:22 pbx kserver-daemon [123]: The system is active.
Jan 1 10:12:14 pbx kserver-daemon [123]: Client connected.

We can see a proper system startup. In case of problems, a warning message is printed identifying the cause of the error. In this case, make sure: